Skip to content

Commit c17b1f4

Browse files
authored
[show][muxcable] Decrease the timeout for show mux status/hwmode (sonic-net#2130)
Signed-off-by: vaibhav-dahiya [email protected] What I did Currently the response for hwmode muxdirection comes from ycabled. Since ycabled might not be running/exited state or if the underlying hardware takes a long time to reciprocate the response for muxdirection, we decrease the timeout for the command, so atleast the user can see the output of CLI in 100ms. How I did it Added a constant timeout variable inside show/muxcable.py How to verify it Ran the change on Test DUT and unit-tests Signed-off-by: vaibhav-dahiya <[email protected]>
1 parent 49d61f8 commit c17b1f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

show/muxcable.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
REDIS_TIMEOUT_MSECS = 0
2020
SELECT_TIMEOUT = 1000
21+
HWMODE_MUXDIRECTION_TIMEOUT = 0.1
2122

2223
# The empty namespace refers to linux host namespace.
2324
EMPTY_NAMESPACE = ''
@@ -1095,7 +1096,7 @@ def get_hwmode_mux_direction_port(db, port):
10951096
if port is not None:
10961097

10971098
res_dict = update_and_get_response_for_xcvr_cmd(
1098-
"state", "state", "True", "XCVRD_SHOW_HWMODE_DIR_CMD", "XCVRD_SHOW_HWMODE_DIR_RES", "XCVRD_SHOW_HWMODE_DIR_RSP", port, 1, None, "probe")
1099+
"state", "state", "True", "XCVRD_SHOW_HWMODE_DIR_CMD", "XCVRD_SHOW_HWMODE_DIR_RES", "XCVRD_SHOW_HWMODE_DIR_RSP", port, HWMODE_MUXDIRECTION_TIMEOUT, None, "probe")
10991100

11001101
result = get_result(port, res_dict, "muxdirection" , result, "XCVRD_SHOW_HWMODE_DIR_RES")
11011102

0 commit comments

Comments
 (0)