blob: d5e071b0d90e9e01eddb8af06bc350963b2f057c [file] [log] [blame]
mbligh4608b002010-01-05 18:22:35 +00001#!/usr/bin/python
2
3import common, logging
4from autotest_lib.client.common_lib import global_config, utils
5from autotest_lib.scheduler import drone_utility
6
7class BaseResultsArchiver(object):
8 def archive_results(self, path):
9 results_host = global_config.global_config.get_config_value(
10 'SCHEDULER', 'results_host', default=None)
showard38b28bf2010-01-12 18:57:37 +000011 if not results_host or results_host == 'localhost':
mbligh4608b002010-01-05 18:22:35 +000012 return
13
showard4b0eb532010-02-03 20:29:29 +000014 if not path.endswith('/'):
15 path += '/'
16
mbligh4608b002010-01-05 18:22:35 +000017 logging.info('Archiving %s to %s', path, results_host)
18 utility = drone_utility.DroneUtility()
19 utility.sync_send_file_to(results_host, path, path, can_fail=True)
20
21
22ResultsArchiver = utils.import_site_class(
23 __file__, 'autotest_lib.scheduler.site_archive_results',
24 'SiteResultsArchiver', BaseResultsArchiver)