From 37695c83cf86b7a163fcf2ffef949b116fe9d2b9 Mon Sep 17 00:00:00 2001 From: Tamer Ahmed Date: Wed, 20 Jan 2021 10:59:26 -0800 Subject: [PATCH] [show]: Use TCP Connection For Muxcable Commands (#1371) Unix domain sockets require privileged access while show command could be run by ro user. Switch muxcable show command to use TCP connection to work with ro user. signed-off-by: Tamer Ahmed --- show/muxcable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/show/muxcable.py b/show/muxcable.py index 3b65e4b638a6..0a099105f86b 100644 --- a/show/muxcable.py +++ b/show/muxcable.py @@ -131,7 +131,7 @@ def status(port, json_output): namespaces = multi_asic.get_front_end_namespaces() for namespace in namespaces: asic_id = multi_asic.get_asic_index_from_namespace(namespace) - 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) port_table_keys[asic_id] = per_npu_statedb[asic_id].keys( @@ -233,7 +233,7 @@ def config(port, json_output): # TO-DO replace the macros with correct swsscommon names #config_db[asic_id] = swsscommon.DBConnector("CONFIG_DB", REDIS_TIMEOUT_MSECS, True, namespace) #mux_tbl_cfg_db[asic_id] = swsscommon.Table(config_db[asic_id], swsscommon.CFG_MUX_CABLE_TABLE_NAME) - per_npu_configdb[asic_id] = ConfigDBConnector(use_unix_socket_path=True, namespace=namespace) + per_npu_configdb[asic_id] = ConfigDBConnector(use_unix_socket_path=False, namespace=namespace) per_npu_configdb[asic_id].connect() mux_tbl_cfg_db[asic_id] = per_npu_configdb[asic_id].get_table("MUX_CABLE") peer_switch_tbl_cfg_db[asic_id] = per_npu_configdb[asic_id].get_table("PEER_SWITCH")