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

added vpn_rr_peer list gen utility

parent f1506d3d
No related branches found
No related tags found
No related merge requests found
......@@ -275,6 +275,20 @@ def ix_public_peers(netconf_config):
}
def vpn_rr_peers(netconf_config):
for r in netconf_config.xpath(
'//configuration/logical-systems[name/text()="VRR"]/'
'/protocols/bgp/'
'group[name/text()="VPN-RR" or name/text()="VPN-RR-INTERNAL"]/'
'neighbor'):
name = r.find('name')
yield {
'name': ipaddress.ip_address(name.text).exploded,
'description': r.find('description').text,
'peer-as': int(r.find('peer-as').text)
}
# note for enabling vrr data parsing ...
# def fetch_vrr_config(hostname, ssh_params):
#
......
......@@ -12,7 +12,8 @@ TEST_DATA_DIRNAME = os.path.realpath(os.path.join(
'test',
'data'))
ROUTER_NAME = 'mx1.vie.at.geant.net'
# ROUTER_NAME = 'mx1.vie.at.geant.net'
ROUTER_NAME = 'mx2.lju.si.geant.net'
@pytest.fixture
......@@ -56,3 +57,9 @@ def test_ix_public_peers(netconf):
for p in juniper.ix_public_peers(netconf):
jsonschema.validate(p, schema)
def test_vpn_rr_peers(netconf):
for p in juniper.vpn_rr_peers(netconf):
print(p)
# jsonschema.validate(p, schema)
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