Skip to content

Commit

Permalink
Fix mux simulator post (#13263)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lolyu authored and mssonicbld committed Jun 13, 2024
1 parent 5ea664e commit 3265b07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/common/dualtor/mux_simulator_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 3265b07

Please sign in to comment.