Skip to content

Commit ed82e02

Browse files
authored
feat(frrcfgd): update for bgp locator config (#21899)
feat(frrcfgd): update for bgp locator config
1 parent e19b0eb commit ed82e02

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sonic-frr-mgmt-framework/frrcfgd/frrcfgd.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,6 @@ class BGPConfigDaemon:
18101810
DEFAULT_VRF = 'default'
18111811

18121812
global_key_map = [('router_id', '{no:no-prefix}bgp router-id {}'),
1813-
('srv6_locator', '{no:no-prefix}srv6-locator {}'),
18141813
(['load_balance_mp_relax', '+as_path_mp_as_set'], '{no:no-prefix}bgp bestpath as-path multipath-relax {:mp-as-set}', ['true', 'false']),
18151814
('always_compare_med', '{no:no-prefix}bgp always-compare-med', ['true', 'false']),
18161815
('external_compare_router_id', '{no:no-prefix}bgp bestpath compare-routerid', ['true', 'false']),
@@ -2739,6 +2738,14 @@ def __update_bgp(self, data_list):
27392738
syslog.syslog(syslog.LOG_ERR, 'local ASN for VRF %s was not configured' % vrf)
27402739
continue
27412740
cmd_prefix = ['configure terminal', 'router bgp {} vrf {}'.format(local_asn, vrf)]
2741+
if 'srv6_locator' in data:
2742+
cmd = "vtysh -c 'configure terminal' "
2743+
cmd += " -c 'router bgp {} vrf {}' ".format(local_asn, vrf)
2744+
cmd += " -c 'segment-routing srv6' "
2745+
cmd += " -c 'locator {}' ".format(data['srv6_locator'].data)
2746+
if not self.__run_command(table, cmd):
2747+
syslog.syslog(syslog.LOG_ERR, 'failed running SRV6 POLICY config command')
2748+
continue
27422749
if not key_map.run_command(self, table, data, cmd_prefix):
27432750
syslog.syslog(syslog.LOG_ERR, 'failed running BGP global config command')
27442751
continue

0 commit comments

Comments
 (0)