Skip to content

Commit

Permalink
fix get empty rib in issue
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Xiao <xiaoquwl@gmail.com>
  • Loading branch information
xiaopeng163 committed Jul 8, 2016
1 parent cc23231 commit 3bf7f24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yabgp/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def send_update(peer_ip, attr, nlri, withdraw):


def get_adj_rib_in(peer_ip, afi_safi, prefix=None):
rib_table = cfg.CONF.bgp.running_config[peer_ip]['factory'].fsm.protocol.get_rib_in().get(afi_safi)
rib_table = cfg.CONF.bgp.running_config[peer_ip]['factory'].fsm.protocol.get_rib_in().get(afi_safi) or {}
if prefix:
attr = rib_table.get(prefix)
if not attr:
Expand All @@ -172,7 +172,7 @@ def get_adj_rib_in(peer_ip, afi_safi, prefix=None):


def get_adj_rib_out(peer_ip, afi_safi, prefix=None):
rib_table = cfg.CONF.bgp.running_config[peer_ip]['factory'].fsm.protocol.get_rib_out().get(afi_safi)
rib_table = cfg.CONF.bgp.running_config[peer_ip]['factory'].fsm.protocol.get_rib_out().get(afi_safi) or {}
if prefix:
attr = rib_table.get(prefix)
if not attr:
Expand All @@ -196,6 +196,6 @@ def restart_bgp_connection(peer_ip):


def get_adj_rib_all(peer_ip, afi_safi):
rib_table = cfg.CONF.bgp.running_config[peer_ip]['factory'].fsm.protocol.get_rib_in().get(afi_safi)
rib_table = cfg.CONF.bgp.running_config[peer_ip]['factory'].fsm.protocol.get_rib_in().get(afi_safi) or {}

return rib_table

0 comments on commit 3bf7f24

Please sign in to comment.