Skip to content

Commit

Permalink
[show][muxcable] fix the sudo access error for show muxcable metrics (#…
Browse files Browse the repository at this point in the history
…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 <vdahiya@microsoft.com>
  • Loading branch information
vdahiya12 authored Mar 4, 2022
1 parent f872516 commit 47c243e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion show/muxcable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 47c243e

Please sign in to comment.