Skip to content

Commit

Permalink
Merge pull request #76 from gechiang/202205
Browse files Browse the repository at this point in the history
[chassis][show-runningconfig] Fix the show runningconfiguration all i…
  • Loading branch information
gechiang authored Jun 13, 2024
2 parents a9d7b12 + 79cb599 commit 47415b8
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 @@ -1277,7 +1277,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, exit_on_fail=False)
if bgp_util.is_bgp_feature_state_enabled(ns):
ns_config['bgpraw'] = bgp_util.run_bgp_show_command(bgpraw_cmd, ns, exit_on_fail=False)
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 47415b8

Please sign in to comment.