[bgpcfgd]: Fix for BGP peer not coming up even after config BGP startup all (#4547)

Issue was key not correct to look into self.peer. It need to be tuple of
(vrf,nbr). Updated for both add/del
This commit is contained in:
abdosi 2020-05-06 19:30:31 -07:00 committed by GitHub
parent 3ae5945cfc
commit fc28af7ce9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -744,7 +744,8 @@ class BGPPeerMgrBase(Manager):
:param data: the data associated with the change
"""
vrf, nbr = self.split_key(key)
if key not in self.peers:
peer_key = (vrf, nbr)
if peer_key not in self.peers:
return self.add_peer(vrf, nbr, data)
else:
return self.update_peer(vrf, nbr, data)
@ -871,7 +872,8 @@ class BGPPeerMgrBase(Manager):
:param key: key of the neighbor
"""
vrf, nbr = self.split_key(key)
if key not in self.peers:
peer_key = (vrf, nbr)
if peer_key not in self.peers:
log_warn("Peer '(%s|%s)' has not been found" % (vrf, nbr))
return
cmd = self.templates["delete"].render(neighbor_addr=nbr)