fixes bugs in network filter for parsing ip address (#28404)

also adds parse_cli and parse_cli_textfsm to changelog
This commit is contained in:
Peter Sprygada
2017-08-18 14:05:26 -04:00
committed by GitHub
parent 54c50cc983
commit 03b888052b
3 changed files with 19 additions and 4 deletions

View File

@@ -131,7 +131,13 @@ def parse_cli(output, tmpl):
else:
items.append(None)
objects.append(dict([(k, template(v, {'item': items})) for k, v in iteritems(value)]))
obj = {}
for k, v in iteritems(value):
try:
obj[k] = template(v, {'item': items}, fail_on_undefined=False)
except:
obj[k] = None
objects.append(obj)
elif isinstance(value, Mapping):
items = list()