From f0e77b22551446d586cbc0749de1a5a70eed38c8 Mon Sep 17 00:00:00 2001 From: Longxiang Lyu <35479537+lolyu@users.noreply.github.com> Date: Thu, 13 Jun 2024 16:27:59 +0800 Subject: [PATCH] Fix mux simulator post (#13263) 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 --- 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 abf187f75f0..0db81c230c9 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])