diff --git a/show/muxcable.py b/show/muxcable.py index 217ab23635..3b65e4b638 100644 --- a/show/muxcable.py +++ b/show/muxcable.py @@ -63,7 +63,7 @@ def get_switch_name(config_db): info_dict = config_db.get_entry("DEVICE_METADATA", "localhost") #click.echo("{} ".format(info_dict)) - switch_name = get_value_for_key_in_dict(info_dict, "localhost", "hostname", "DEVICE_METADATA") + switch_name = get_value_for_key_in_dict(info_dict, "localhost", "peer_switch", "DEVICE_METADATA") if switch_name is not None: return switch_name else: diff --git a/tests/mock_tables/config_db.json b/tests/mock_tables/config_db.json index 21676feb57..a8da97f3eb 100644 --- a/tests/mock_tables/config_db.json +++ b/tests/mock_tables/config_db.json @@ -666,6 +666,7 @@ "hwsku": "Mellanox-SN3800-D112C8", "mac": "1d:34:db:16:a6:00", "platform": "x86_64-mlnx_msn3800-r0", + "peer_switch": "sonic-switch", "type": "ToRRouter" }, "DEVICE_NEIGHBOR|Ethernet4": {