Skip to content

Commit 37695c8

Browse files
authored
[show]: Use TCP Connection For Muxcable Commands (sonic-net#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 <tamer.ahmed@microsoft.com>
1 parent 8119ba2 commit 37695c8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

show/muxcable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def status(port, json_output):
131131
namespaces = multi_asic.get_front_end_namespaces()
132132
for namespace in namespaces:
133133
asic_id = multi_asic.get_asic_index_from_namespace(namespace)
134-
per_npu_statedb[asic_id] = swsscommon.SonicV2Connector(use_unix_socket_path=True, namespace=namespace)
134+
per_npu_statedb[asic_id] = swsscommon.SonicV2Connector(use_unix_socket_path=False, namespace=namespace)
135135
per_npu_statedb[asic_id].connect(per_npu_statedb[asic_id].STATE_DB)
136136

137137
port_table_keys[asic_id] = per_npu_statedb[asic_id].keys(
@@ -233,7 +233,7 @@ def config(port, json_output):
233233
# TO-DO replace the macros with correct swsscommon names
234234
#config_db[asic_id] = swsscommon.DBConnector("CONFIG_DB", REDIS_TIMEOUT_MSECS, True, namespace)
235235
#mux_tbl_cfg_db[asic_id] = swsscommon.Table(config_db[asic_id], swsscommon.CFG_MUX_CABLE_TABLE_NAME)
236-
per_npu_configdb[asic_id] = ConfigDBConnector(use_unix_socket_path=True, namespace=namespace)
236+
per_npu_configdb[asic_id] = ConfigDBConnector(use_unix_socket_path=False, namespace=namespace)
237237
per_npu_configdb[asic_id].connect()
238238
mux_tbl_cfg_db[asic_id] = per_npu_configdb[asic_id].get_table("MUX_CABLE")
239239
peer_switch_tbl_cfg_db[asic_id] = per_npu_configdb[asic_id].get_table("PEER_SWITCH")

0 commit comments

Comments
 (0)