diff --git a/inventory_provider/juniper.py b/inventory_provider/juniper.py index 680648625818dee03abe9dcb11f204df55a2e59d..cb7a198892d734ec5b4695fa7856761f2b405405 100644 --- a/inventory_provider/juniper.py +++ b/inventory_provider/juniper.py @@ -252,6 +252,30 @@ def list_bgp_routes(netconf_config): } } + +def ix_public_peers(netconf_config): + for r in netconf_config.xpath( + '//configuration/routing-instances/' + 'instance[name/text()="IAS"]/protocols/bgp/' + 'group[starts-with(name/text(), "GEANT-IX")]/' + 'neighbor'): + name = r.find('name') + description = r.find('description') + local_as = r.find('local-as') + if local_as is not None: + local_as = local_as.find('as-number') + peer_as = r.find('peer-as') + yield { + 'name': ipaddress.ip_address(name.text), + 'description': description.text, + 'as': { + 'local': int(local_as.text), + 'peer': int(peer_as.text) + } + } + + + # note for enabling vrr data parsing ... # def fetch_vrr_config(hostname, ssh_params): #