[autotest] Forward set_host_attribute RPC
set_host_attribute RPC should be forwarded to shards of affected
hosts to update not only master DB but also the shards' DB.
BUG=chromium:492822
TEST=puppylab. Run ./atest/host mod -a testattr=hello1 test_host11
on the master VM. test_host11 is a host of stumpy shard.
Check if its host attribute has been affected in both master DB
and stumpy shard DB.
DEPLOY=apache
Change-Id: I1fb940ce92df8ca9afe1986cccc517b09c96f43e
Reviewed-on: https://chromium-review.googlesource.com/273947
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 4efc71c..c043ae7 100644
--- a/frontend/afe/rpc_utils.py
+++ b/frontend/afe/rpc_utils.py
@@ -1153,7 +1153,8 @@
# their keywords, so this is not a problem.
host = models.Host.smart_get(kwargs['id'])
if host.shard and not server_utils.is_shard():
- run_rpc_on_multiple_hostnames(func.func_name, [host.shard.hostname],
+ run_rpc_on_multiple_hostnames(func.func_name,
+ [host.shard.rpc_hostname()],
**kwargs)
return func(**kwargs)