Skip to content

Commit

Permalink
[cli][bgp]use vtysh in the show ip bgp summary command (#1137)
Browse files Browse the repository at this point in the history
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>

Modify the run_bgp_command function to call vtysh with correct instance_id and vtysh cmd.
The vtysh script is modified to take the namespace id in this PR sonic-net/sonic-buildimage#5479
  • Loading branch information
malletvapid23 committed Sep 29, 2020
1 parent 693fd16 commit 302fb22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utilities_common/bgp_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ def run_bgp_command(vtysh_cmd, bgp_namespace=multi_asic.DEFAULT_NAMESPACE):
bgp_instance_id = ' '
output = None
if bgp_namespace is not multi_asic.DEFAULT_NAMESPACE:
bgp_instance_id = multi_asic.get_asic_id_from_name(bgp_namespace)
bgp_instance_id = " -n {} ".format(multi_asic.get_asic_id_from_name(bgp_namespace))

cmd = 'sudo docker exec bgp{} vtysh -c "{}"'.format(
cmd = 'sudo vtysh {} -c "{}"'.format(
bgp_instance_id, vtysh_cmd)
try:
output = clicommon.run_command(cmd, return_cmd=True)
Expand Down

0 comments on commit 302fb22

Please sign in to comment.