qa: fix the UDS class' forwarding method calls as JSONRPC calls

We weren't passing arguments if they were a list!
This commit is contained in:
Antoine Poinsot 2022-09-09 16:45:57 +02:00
parent 9afd44061e
commit 09f59c417b
No known key found for this signature in database
GPG Key ID: E13FC145CD3F4304

View File

@ -152,14 +152,12 @@ class UnixDomainSocketRpc(object):
We might still want to define the actual methods in the subclasses for
documentation purposes.
"""
name = name.replace("_", "-")
def wrapper(*args, **kwargs):
if len(args) != 0 and len(kwargs) != 0:
raise RpcError(
name, {}, "Cannot mix positional and non-positional arguments"
)
return self.call(name, params=kwargs)
return self.call(name, params=args or kwargs)
return wrapper