Skip to content

Commit

Permalink
[minigraph.py]: Use default namespace for <Address> (#3695)
Browse files Browse the repository at this point in the history
* [minigraph.py]: Use default namespace for <Address>
  • Loading branch information
pavel-shirshov authored and yxieca committed Nov 7, 2019
1 parent 90fb363 commit b9b56c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ def parse_cpg(cpg, hname):
'name': name,
'ip_range': ip_range_group
}
if bgpPeer.find(str(QName(ns1, "Address"))) is not None:
bgp_peers_with_range[name]['src_address'] = bgpPeer.find(str(QName(ns1, "Address"))).text
if bgpPeer.find(str(QName(ns, "Address"))) is not None:
bgp_peers_with_range[name]['src_address'] = bgpPeer.find(str(QName(ns, "Address"))).text
if bgpPeer.find(str(QName(ns1, "PeerAsn"))) is not None:
bgp_peers_with_range[name]['peer_asn'] = bgpPeer.find(str(QName(ns1, "PeerAsn"))).text
else:
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-config-engine/tests/test_cfggen.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def test_minigraph_bgp(self):
def test_minigraph_peers_with_range(self):
argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v BGP_PEER_RANGE.values\(\)'
output = self.run_script(argument)
self.assertEqual(output.strip(), "[{'name': 'BGPSLBPassive', 'ip_range': ['10.10.10.10/26', '100.100.100.100/26']}]")
self.assertEqual(output.strip(), "[{'src_address': '10.1.0.32', 'name': 'BGPSLBPassive', 'ip_range': ['10.10.10.10/26', '100.100.100.100/26']}]")

def test_minigraph_deployment_id(self):
argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'deployment_id\']"'
Expand Down

0 comments on commit b9b56c9

Please sign in to comment.