From ffcfff0ec07e2b747222b109179d1125aad07400 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:08:01 +0800 Subject: [PATCH] Fix mux simulator post (#13263) (#13272) What is the motivation for this PR? Fix the ValueError for mux simulator utilities: 08:21:52 mux_simulator_control._post L0196 WARNING| POST http://10.64.*.*:8082/mux/vms21-6 with data {'active_side': 'lower_tor'} failed, err: ValueError('Function has keyword-only parameters or annotations, use inspect.signature() API which can support them') How did you do it? Use inspect.signature instead. How did you verify/test it? Run over dualtor testbed. Signed-off-by: Longxiang Lyu Co-authored-by: Longxiang Lyu <35479537+lolyu@users.noreply.github.com> --- tests/common/dualtor/mux_simulator_control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/common/dualtor/mux_simulator_control.py b/tests/common/dualtor/mux_simulator_control.py index c47e8ba412a..10bdb52e7f2 100644 --- a/tests/common/dualtor/mux_simulator_control.py +++ b/tests/common/dualtor/mux_simulator_control.py @@ -176,7 +176,7 @@ def _post(server_url, data): """ try: session = Session() - if "allowed_methods" in inspect.getargspec(Retry).args: + if "allowed_methods" in inspect.signature(Retry).parameters: retry = Retry(total=3, connect=3, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST']), status_forcelist=[x for x in requests.status_codes._codes if x != 200])