[autotest] Disallow frontend jobs on hosts given to shards.
TEST=Ran jobs and checked exceptions.
Ran jobs on non-shard hosts.
BUG=chromium:431789
DEPLOY=apache
Change-Id: Ide385ed1db135a7e98ab0385df1f9a64d97bd631
Reviewed-on: https://chromium-review.googlesource.com/231735
Tested-by: Prashanth B <beeps@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Prashanth B <beeps@chromium.org>
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index a21bd06..76095c4 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -734,6 +734,11 @@
@returns A list of hostnames that a special task was created for.
"""
models.AclGroup.check_for_acl_violation_hosts(hosts)
+ shard_host_map = rpc_utils.bucket_hosts_by_shard(hosts)
+ if shard_host_map:
+ raise ValueError('The following hosts are on shards, please '
+ 'follow the link to the shards and create jobs '
+ 'there instead. %s.' % shard_host_map)
for host in hosts:
models.SpecialTask.schedule_special_task(host, task)
return list(sorted(host.hostname for host in hosts))