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
|
UNKNOWN = 0x1
|
||||||
SUCCESS = 0x2
|
SUCCESS = 0x2
|
||||||
ERROR = 0x3
|
ERROR = 0x3
|
||||||
|
NOTFOUND = 0x4
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def to_str(cls, state):
|
def to_str(cls, state):
|
||||||
|
@@ -284,16 +284,17 @@ class ifupdownMain():
|
|||||||
if dlist is None:
|
if dlist is None:
|
||||||
dlist = self.get_dependents(ifaceobj, op)
|
dlist = self.get_dependents(ifaceobj, op)
|
||||||
else:
|
else:
|
||||||
# we already have dependency info for this interface
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
self.preprocess_dependency_list(dlist, op)
|
if dlist is not None:
|
||||||
ifaceobj.set_dependents(dlist)
|
self.preprocess_dependency_list(dlist, op)
|
||||||
|
ifaceobj.set_dependents(dlist)
|
||||||
|
|
||||||
if dependency_graph.get(i) is None:
|
if dependency_graph.get(i) is None:
|
||||||
dependency_graph[i] = dlist
|
dependency_graph[i] = dlist
|
||||||
|
|
||||||
self.generate_dependency_info(dlist, dependency_graph, op)
|
if dlist is not None:
|
||||||
|
self.generate_dependency_info(dlist, dependency_graph, op)
|
||||||
|
|
||||||
def is_valid_state_transition(self, ifname, to_be_state):
|
def is_valid_state_transition(self, ifname, to_be_state):
|
||||||
return self.statemanager.is_valid_state_transition(ifname,
|
return self.statemanager.is_valid_state_transition(ifname,
|
||||||
@@ -688,9 +689,13 @@ class ifupdownMain():
|
|||||||
ret = 0
|
ret = 0
|
||||||
for i in ifacenames:
|
for i in ifacenames:
|
||||||
ifaceobj = self.get_ifaceobjcurr(i)
|
ifaceobj = self.get_ifaceobjcurr(i)
|
||||||
ifaceobj.dump_pretty(self.logger)
|
if ifaceobj.get_status() == ifaceStatus.NOTFOUND:
|
||||||
if ifaceobj.get_status() == ifaceStatus.ERROR:
|
print 'iface %s' %ifaceobj.get_name() + ' (not found)'
|
||||||
ret = 1
|
ret = 1
|
||||||
|
continue
|
||||||
|
elif ifaceobj.get_status() == ifaceStatus.ERROR:
|
||||||
|
ret = 1
|
||||||
|
ifaceobj.dump_pretty(self.logger)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
@@ -95,8 +95,9 @@ def update_argparser(argparser):
|
|||||||
argparser.add_argument('-j', '--jobs', dest='jobs', type=int,
|
argparser.add_argument('-j', '--jobs', dest='jobs', type=int,
|
||||||
default=-1, choices=range(1,12), help=argparse.SUPPRESS)
|
default=-1, choices=range(1,12), help=argparse.SUPPRESS)
|
||||||
argparser.add_argument('-X', '--exclude', dest='excludepats',
|
argparser.add_argument('-X', '--exclude', dest='excludepats',
|
||||||
action='append', help='print out what would happen,' +
|
action='append', help='exclude interfaces from the list of '
|
||||||
' but don\'t do it')
|
+ 'interfaces to operate on by a PATTERN '
|
||||||
|
+ '(note that this option doesn\'t disable mappings)')
|
||||||
|
|
||||||
|
|
||||||
def update_ifupdown_argparser(argparser):
|
def update_ifupdown_argparser(argparser):
|
||||||
|
Reference in New Issue
Block a user