Skip to content
Snippets Groups Projects
Commit 1a45c3f4 authored by Erik Reid's avatar Erik Reid
Browse files

flatten interface data response

parent 3d69d5e5
No related branches found
No related tags found
No related merge requests found
......@@ -123,10 +123,10 @@ def bgp_configs(hostname):
def _interfaces(s):
for ifc in json.loads(s):
yield {
"description": ifc["description"][0],
"description": ifc["description"][0]["data"],
"as": {
"peer": ifc["peer-as"][0],
"local": ifc["local-as"][0]["as-number"][0]
"peer": ifc["peer-as"][0]["data"],
"local": ifc["local-as"][0]["as-number"][0]["data"]
}
}
interfaces = list(_interfaces(bgp_data_string.decode('utf-8')))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment