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

minor fixes + cleanup + update manpage

Ticket: CM-1438
Reviewed By:
Testing Done:

- simplified the dot generator
This commit is contained in:
roopa
2014-02-15 21:39:13 -08:00
parent 0ff44a76ac
commit 83c1f241fd
7 changed files with 58 additions and 54 deletions

View File

@@ -110,11 +110,19 @@ class ifaceState():
class ifaceJsonEncoder(json.JSONEncoder):
def default(self, o):
retconfig = {}
if o.config:
for k, v in o.config.items():
if len(v) == 1:
retconfig[k] = v[0]
else:
retconfig[k] = v
return OrderedDict({'name' : o.name,
'addr_method' : o.addr_method,
'addr_family' : o.addr_family,
'auto' : o.auto,
'config' : o.config})
'config' : retconfig})
class iface():
""" config flags """