Skip to content

Commit 815e2ef

Browse files
[minigraph.py]: Use default namespace for <Address> (#3695)
* [minigraph.py]: Use default namespace for <Address>
1 parent 6cc1f99 commit 815e2ef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/sonic-config-engine/minigraph.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ def parse_cpg(cpg, hname):
386386
'name': name,
387387
'ip_range': ip_range_group
388388
}
389-
if bgpPeer.find(str(QName(ns1, "Address"))) is not None:
390-
bgp_peers_with_range[name]['src_address'] = bgpPeer.find(str(QName(ns1, "Address"))).text
389+
if bgpPeer.find(str(QName(ns, "Address"))) is not None:
390+
bgp_peers_with_range[name]['src_address'] = bgpPeer.find(str(QName(ns, "Address"))).text
391391
if bgpPeer.find(str(QName(ns1, "PeerAsn"))) is not None:
392392
bgp_peers_with_range[name]['peer_asn'] = bgpPeer.find(str(QName(ns1, "PeerAsn"))).text
393393
else:

src/sonic-config-engine/tests/test_cfggen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def test_minigraph_bgp(self):
194194
def test_minigraph_peers_with_range(self):
195195
argument = '-m "' + self.sample_graph_bgp_speaker + '" -p "' + self.port_config + '" -v BGP_PEER_RANGE.values\(\)'
196196
output = self.run_script(argument)
197-
self.assertEqual(output.strip(), "[{'name': 'BGPSLBPassive', 'ip_range': ['10.10.10.10/26', '100.100.100.100/26']}]")
197+
self.assertEqual(output.strip(), "[{'src_address': '10.1.0.32', 'name': 'BGPSLBPassive', 'ip_range': ['10.10.10.10/26', '100.100.100.100/26']}]")
198198

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

0 commit comments

Comments
 (0)