[autotest] Make route_rpc_to_master decorator allow positional arguments
With the help of inspect.getcallargs(), we can call a decorated function
with positional arguments.
BUG=chromium:506316
TEST=Clone a job in dummy suite that was run before on local machine.
DEPLOY=apache
Change-Id: I6828f465dfb341f84ec7c7721432977bde4630b6
Reviewed-on: https://chromium-review.googlesource.com/283491
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
diff --git a/frontend/afe/rpc_utils.py b/frontend/afe/rpc_utils.py
index 19e8d6a..6e03611 100644
--- a/frontend/afe/rpc_utils.py
+++ b/frontend/afe/rpc_utils.py
@@ -1291,7 +1291,8 @@
@returns: The function to replace func with.
"""
@wraps(func)
- def replacement(**kwargs):
+ def replacement(*args, **kwargs):
+ kwargs = inspect.getcallargs(func, *args, **kwargs)
if server_utils.is_shard():
afe = frontend_wrappers.RetryingAFE(
server=get_global_afe_hostname())