mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
ifupdown: iface: now trimming json values right after parsing
Ticket: None Reviewed By: Roopa Testing Done: smoke/testifupdown2.py:TestMakoJson ifupdown2.TestMakoJson test was failing because the json values werent trimmed Because of a trailing whitespace, a list of iface had an empty value, ifupdown2 was throwing an exception. Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
@@ -281,7 +281,7 @@ class ifaceJsonDecoder():
|
||||
@classmethod
|
||||
def json_to_ifaceobj(cls, ifaceattrdict):
|
||||
ifaceattrdict['config'] = OrderedDict([(k, (v if isinstance(v, list)
|
||||
else [v]))
|
||||
else [v.strip()]))
|
||||
for k,v in ifaceattrdict.get('config',
|
||||
OrderedDict()).items()])
|
||||
return iface(attrsdict=ifaceattrdict)
|
||||
|
Reference in New Issue
Block a user