Skip to content

Commit

Permalink
Fix mux simulator post (#13263) (#13272)
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]>
Co-authored-by: Longxiang Lyu <[email protected]>
  • Loading branch information
mssonicbld and lolyu authored Jun 14, 2024
1 parent 6de271e commit ffcfff0
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 ffcfff0

Please sign in to comment.