Ticket: CM-10302
Reviewed By: julien
Testing Done: Tested ifdown of an interface and make sure the addresses
are deleted
cache_invalidate can be called when an interface gets deleted
or on any other deletion event (this is because we dont really
know, what other things have been implicitly deleted by the kernel).
on ifdown, the cache can get invalidated. But if we dont
reset the cache flag, the fill cache functions can still think
the cache is valid and can return None for any queries.
This was happening to address queries, which resulted in
leaving behind configured addresses. because ifdown
thought that there were no running addresses on the interface.
if ifacename argument given, fill cache for ifacename, else
fill cache for all interfaces in the system
"""
-
linkout = {}
if iproute2._cache_fill_done and not refresh: return
+
try:
# Check if ifacename is already full, in which case, return
if ifacename and not refresh:
def _cache_invalidate(self):
linkCache.invalidate()
+ iproute2._cache_fill_done = False
def batch_start(self):
self.ipbatcbuf = ''