[autotest] Treat special task labels like "provisionable" labels.

As it stands, to use the special task labels, you need to add the label
to every host, since we still treat it as a normal/standard DEPENDENCY.

If any special task treats a label differently, then we shouldn't
require that label on the DUT, as we're using it as a marker that we
want some special handling of this test rather than an actual
dependency.

BUG=chromium:334418
DEPLOY=scheduler, apache
TEST=added a potato->dummy_PassServer mapping, saw dummy_PassServer run
in cleanup on job with DEPENDENCIES=potato where host didn't have
potato.

Change-Id: I34936a5a84a42897c8dfc0e2acd50195e0e74ec5
Reviewed-on: https://chromium-review.googlesource.com/194212
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
diff --git a/frontend/afe/rpc_utils.py b/frontend/afe/rpc_utils.py
index b126aff..7041cd3 100644
--- a/frontend/afe/rpc_utils.py
+++ b/frontend/afe/rpc_utils.py
@@ -235,7 +235,7 @@
     hosts_in_job = models.Host.objects.filter(id__in=host_ids)
     ok_hosts = hosts_in_job
     for index, dependency in enumerate(job_dependencies):
-        if not provision.can_provision(dependency):
+        if not provision.is_for_special_action(dependency):
             ok_hosts = ok_hosts.filter(labels__name=dependency)
     failing_hosts = (set(host.hostname for host in host_objects) -
                      set(host.hostname for host in ok_hosts))
@@ -258,7 +258,7 @@
     for metahost in metahost_objects:
         hosts = models.Host.objects.filter(labels=metahost)
         for label_name in job_dependencies:
-            if not provision.can_provision(label_name):
+            if not provision.is_for_special_action(label_name):
                 hosts = hosts.filter(labels__name=label_name)
         if not any(hosts):
             raise error.NoEligibleHostException("No hosts within %s satisfy %s."
@@ -509,7 +509,7 @@
     check_for_duplicate_hosts(host_objects)
 
     for label_name in dependencies:
-        if provision.can_provision(label_name):
+        if provision.is_for_special_action(label_name):
             # TODO: We could save a few queries
             # if we had a bulk ensure-label-exists function, which used
             # a bulk .get() call. The win is probably very small.