mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
cleanup ifquery for interfaces that were configured but got deleted or
went away Ticket: CM-1438 Reviewed By: Testing Done:
This commit is contained in:
@@ -20,6 +20,7 @@ class ifaceStatus():
|
||||
UNKNOWN = 0x1
|
||||
SUCCESS = 0x2
|
||||
ERROR = 0x3
|
||||
NOTFOUND = 0x4
|
||||
|
||||
@classmethod
|
||||
def to_str(cls, state):
|
||||
|
@@ -284,15 +284,16 @@ class ifupdownMain():
|
||||
if dlist is None:
|
||||
dlist = self.get_dependents(ifaceobj, op)
|
||||
else:
|
||||
# we already have dependency info for this interface
|
||||
continue
|
||||
|
||||
if dlist is not None:
|
||||
self.preprocess_dependency_list(dlist, op)
|
||||
ifaceobj.set_dependents(dlist)
|
||||
|
||||
if dependency_graph.get(i) is None:
|
||||
dependency_graph[i] = dlist
|
||||
|
||||
if dlist is not None:
|
||||
self.generate_dependency_info(dlist, dependency_graph, op)
|
||||
|
||||
def is_valid_state_transition(self, ifname, to_be_state):
|
||||
@@ -688,9 +689,13 @@ class ifupdownMain():
|
||||
ret = 0
|
||||
for i in ifacenames:
|
||||
ifaceobj = self.get_ifaceobjcurr(i)
|
||||
ifaceobj.dump_pretty(self.logger)
|
||||
if ifaceobj.get_status() == ifaceStatus.ERROR:
|
||||
if ifaceobj.get_status() == ifaceStatus.NOTFOUND:
|
||||
print 'iface %s' %ifaceobj.get_name() + ' (not found)'
|
||||
ret = 1
|
||||
continue
|
||||
elif ifaceobj.get_status() == ifaceStatus.ERROR:
|
||||
ret = 1
|
||||
ifaceobj.dump_pretty(self.logger)
|
||||
|
||||
return ret
|
||||
|
||||
|
@@ -95,8 +95,9 @@ def update_argparser(argparser):
|
||||
argparser.add_argument('-j', '--jobs', dest='jobs', type=int,
|
||||
default=-1, choices=range(1,12), help=argparse.SUPPRESS)
|
||||
argparser.add_argument('-X', '--exclude', dest='excludepats',
|
||||
action='append', help='print out what would happen,' +
|
||||
' but don\'t do it')
|
||||
action='append', help='exclude interfaces from the list of '
|
||||
+ 'interfaces to operate on by a PATTERN '
|
||||
+ '(note that this option doesn\'t disable mappings)')
|
||||
|
||||
|
||||
def update_ifupdown_argparser(argparser):
|
||||
|
Reference in New Issue
Block a user