Autotest: Stop pulling back verify/cleanup jobs to the main scheduler.

Currently we are pulling back special agent tasks (Verify, Cleanup, and
repair) results that reside in /usr/local/autotest/results/hosts/* to the
main scheduler server.

These changes add a flag to the global_config that if set to False we will
not pull these results back.

BUG=chromium-os:33062
TEST=Setup my own autotest scheduler server with a remote drone to
verify that setting/disabling the flag enables/disables the pulling of
special agent task results.

Change-Id: I66b4c0852f9d5ebe45473a2fff7c78d41bc0622e
Reviewed-on: https://gerrit.chromium.org/gerrit/29098
Commit-Ready: Simran Basi <sbasi@google.com>
Reviewed-by: Simran Basi <sbasi@google.com>
Tested-by: Simran Basi <sbasi@google.com>
diff --git a/scheduler/site_drone_manager.py b/scheduler/site_drone_manager.py
new file mode 100644
index 0000000..53a7595
--- /dev/null
+++ b/scheduler/site_drone_manager.py
@@ -0,0 +1,32 @@
+# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+import logging
+
+from autotest_lib.client.common_lib import global_config
+from autotest_lib.scheduler import scheduler_config
+
+HOSTS_JOB_SUBDIR = 'hosts/'
+
+
+class SiteDroneManager(object):
+
+
+    def copy_to_results_repository(self, process, source_path,
+                                   destination_path=None):
+        """
+        Copy results from the given process at source_path to destination_path
+        in the results repository.
+
+        This site subclassed version will only copy the results back for Special
+        Agent Tasks (Cleanup, Verify, Repair) that reside in the hosts/
+        subdirectory of results if the copy_task_results_back flag has been set
+        to True inside global_config.ini
+        """
+        copy_task_results_back = global_config.global_config.get_config_value(
+                scheduler_config.CONFIG_SECTION, 'copy_task_results_back',
+                type=bool)
+        special_task = source_path.startswith(HOSTS_JOB_SUBDIR)
+        if copy_task_results_back or not special_task:
+            super(SiteDroneManager, self).copy_to_results_repository(process,
+                    source_path, destination_path)
\ No newline at end of file