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

only add peer as element if present

parent cde08092
No related branches found
No related tags found
No related merge requests found
......@@ -281,15 +281,14 @@ def vpn_rr_peers(netconf_config):
'/protocols/bgp/'
'group[name/text()="VPN-RR" or name/text()="VPN-RR-INTERNAL"]/'
'neighbor'):
peer_as = r.find('peer-as')
if peer_as is not None:
peer_as = int(r.find('peer-as').text)
yield {
neighbor = {
'name': ipaddress.ip_address(r.find('name').text).exploded,
'description': r.find('description').text,
'peer-as': peer_as
}
peer_as = r.find('peer-as')
if peer_as is not None:
neighbor['peer-as'] = int(r.find('peer-as').text)
yield neighbor
# note for enabling vrr data parsing ...
# def fetch_vrr_config(hostname, ssh_params):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment