1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

Some fixes + enhancements

Ticket: CM-1438
Reviewed By:
Testing Done: Tested installing new ifupdown on the box

- fixed a few things in ifquery
- added new perfmode to skip some of the checks (useful during boot when there is
  no previous state)
- updated doc dir with example
- Added README, TODO and KNOWN_ISSUES file
This commit is contained in:
roopa
2013-11-10 22:35:40 -08:00
parent a6f80f0e0b
commit eab25b7c62
10 changed files with 215 additions and 72 deletions

View File

@@ -223,26 +223,27 @@ class stateManager():
return True
def print_state(self, ifaceobj, prefix, indent):
print ('%s' %indent + '%s' %prefix +
'%s' %firstifaceobj.get_state_str(),
', %s' %firstifaceobj.get_status_str())
print (indent + '%s' %prefix +
'%s' %ifaceobj.get_state_str() +
', %s' %ifaceobj.get_status_str())
def print_state_pretty(self, ifacenames, logger):
for ifacename in ifacenames:
old_ifaceobjs = self.ifaceobjdict.get(ifacename)
if old_ifaceobjs is not None:
firstifaceobj = old_ifaceobjs[0]
self.print_state(self, firstifaceobj,
'%s: ' %firstifaceobj.get_name(), indent)
self.print_state(firstifaceobj,
'%s: ' %firstifaceobj.get_name(), '')
def print_state_detailed_pretty(self, ifacenames, logger):
indent = '\t'
for ifacename in ifacenames:
old_ifaceobjs = self.ifaceobjdict.get(ifacename)
if old_ifaceobjs is not None:
for i in old_ifaceobjs:
i.dump_pretty(logger)
self.print_state(self, firstifaceobj, '', indent)
self.print_state(i, '', indent)
print '\n'
def dump(self, ifacenames=None):
print 'iface state:'