[autotest] enable running special task from AFE on shard
Only raise error if the special task is queued from master AFE for a host
belongs to a shard.
BUG=None
TEST=vms
DEPLOY=apache
Change-Id: I917a2727c6c7b115c4765b2fccfc71ed8db7589f
Reviewed-on: https://chromium-review.googlesource.com/236020
Reviewed-by: Prashanth B <beeps@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index fc75020..4ef6b5a 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -774,7 +774,7 @@
"""
models.AclGroup.check_for_acl_violation_hosts(hosts)
shard_host_map = rpc_utils.bucket_hosts_by_shard(hosts)
- if shard_host_map:
+ if shard_host_map and not rpc_utils.is_shard():
raise ValueError('The following hosts are on shards, please '
'follow the link to the shards and create jobs '
'there instead. %s.' % shard_host_map)