Skip to content

Commit

Permalink
[chassis][show-runningconfig] Fix the show runningconfiguration all i…
Browse files Browse the repository at this point in the history
…ssue on the Supervisor (sonic-net#3194)

Signed-off-by: mlok <marty.lok@nokia.com>
  • Loading branch information
mlok-nokia authored Mar 14, 2024
1 parent 1a9261c commit 9d53201
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,8 @@ def all(verbose):
ns_list = multi_asic.get_namespace_list()
for ns in ns_list:
ns_config = get_config_json_by_namespace(ns)
ns_config['bgpraw'] = bgp_util.run_bgp_show_command(bgpraw_cmd, ns)
if bgp_util.is_bgp_feature_state_enabled(ns):
ns_config['bgpraw'] = bgp_util.run_bgp_show_command(bgpraw_cmd, ns)
output[ns] = ns_config
click.echo(json.dumps(output, indent=4))
else:
Expand Down
9 changes: 9 additions & 0 deletions utilities_common/bgp_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ def is_bgp_neigh_present(neighbor_ip, namespace=multi_asic.DEFAULT_NAMESPACE):
return False


def is_bgp_feature_state_enabled(namespace=multi_asic.DEFAULT_NAMESPACE):
config_db = multi_asic.connect_config_db_for_ns(namespace)
bgp= config_db.get_entry("FEATURE","bgp")
if "state" in bgp:
if bgp["state"] == "enabled":
return True
return False


def is_ipv4_address(ip_address):
"""
Checks if given ip is ipv4
Expand Down

0 comments on commit 9d53201

Please sign in to comment.