From 47c243eb7e9cbe6ebd3479290a98183071cf2124 Mon Sep 17 00:00:00 2001 From: vdahiya12 <67608553+vdahiya12@users.noreply.github.com> Date: Thu, 3 Mar 2022 19:17:00 -0800 Subject: [PATCH] [show][muxcable] fix the sudo access error for show muxcable metrics (#2083) This change is required for such behavior with the command below, which works okay if you try with sudo How to verify it with the change, no need for sudo, tested on an arista 7050cx3 lab device vdahiya@sonic:~$ show mux metrics Ethernet0 PORT EVENT TIME --------- ---------------------------- --------------------------- Ethernet0 linkmgrd_switch_active_start 2022-Feb-28 18:49:59.350302 Ethernet0 xcvrd_switch_active_start 2022-Feb-28 18:49:59.354076 Ethernet0 xcvrd_switch_active_end 2022-Feb-28 18:49:59.357925 Ethernet0 linkmgrd_switch_active_end 2022-Feb-28 18:49:59.35919 Signed-off-by: vaibhav-dahiya --- show/muxcable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/show/muxcable.py b/show/muxcable.py index 72899a7dae3b..34f4224fc6b5 100644 --- a/show/muxcable.py +++ b/show/muxcable.py @@ -1068,7 +1068,7 @@ def metrics(db, port, json_output): for namespace in namespaces: asic_id = multi_asic.get_asic_index_from_namespace(namespace) # replace these with correct macros - per_npu_statedb[asic_id] = swsscommon.SonicV2Connector(use_unix_socket_path=True, namespace=namespace) + per_npu_statedb[asic_id] = swsscommon.SonicV2Connector(use_unix_socket_path=False, namespace=namespace) per_npu_statedb[asic_id].connect(per_npu_statedb[asic_id].STATE_DB) metrics_table_keys[asic_id] = per_npu_statedb[asic_id].keys(