mbligh | 4608b00 | 2010-01-05 18:22:35 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | import common, logging |
| 4 | from autotest_lib.client.common_lib import global_config, utils |
| 5 | from autotest_lib.scheduler import drone_utility |
| 6 | |
| 7 | class BaseResultsArchiver(object): |
| 8 | def archive_results(self, path): |
| 9 | results_host = global_config.global_config.get_config_value( |
| 10 | 'SCHEDULER', 'results_host', default=None) |
showard | 38b28bf | 2010-01-12 18:57:37 +0000 | [diff] [blame] | 11 | if not results_host or results_host == 'localhost': |
mbligh | 4608b00 | 2010-01-05 18:22:35 +0000 | [diff] [blame] | 12 | return |
| 13 | |
showard | 4b0eb53 | 2010-02-03 20:29:29 +0000 | [diff] [blame] | 14 | if not path.endswith('/'): |
| 15 | path += '/' |
| 16 | |
mbligh | 4608b00 | 2010-01-05 18:22:35 +0000 | [diff] [blame] | 17 | 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 | |
| 22 | ResultsArchiver = utils.import_site_class( |
| 23 | __file__, 'autotest_lib.scheduler.site_archive_results', |
| 24 | 'SiteResultsArchiver', BaseResultsArchiver) |