OLD | NEW |
1 import os, logging, ConfigParser | 1 import os, logging, ConfigParser |
2 from autotest_lib.client.common_lib import autotemp, base_packages, error | 2 from autotest_lib.client.common_lib import autotemp, base_packages, error |
3 from autotest_lib.client.common_lib import global_config | 3 from autotest_lib.client.common_lib import global_config |
4 from autotest_lib.client.bin import harness | 4 from autotest_lib.client.bin import harness |
5 | 5 |
6 | 6 |
7 class harness_autoserv(harness.harness): | 7 class harness_autoserv(harness.harness): |
8 """ | 8 """ |
9 The server harness for running from autoserv | 9 The server harness for running from autoserv |
10 | 10 |
11 Properties: | 11 Properties: |
12 job | 12 job |
13 The job object for this job | 13 The job object for this job |
14 """ | 14 """ |
15 | 15 |
16 def __init__(self, job): | 16 def __init__(self, job, harness_args): |
17 """ | 17 """ |
18 job | 18 job |
19 The job object for this job | 19 The job object for this job |
20 """ | 20 """ |
21 super(harness_autoserv, self).__init__(job) | 21 super(harness_autoserv, self).__init__(job) |
22 self.status = os.fdopen(3, 'w', 0) | 22 self.status = os.fdopen(3, 'w', 0) |
23 | 23 |
24 # If a bug on the client run code prevents global_config.ini | 24 # If a bug on the client run code prevents global_config.ini |
25 # from being copied to the client machine, the client will run | 25 # from being copied to the client machine, the client will run |
26 # without a global config, relying only on the defaults of the | 26 # without a global config, relying only on the defaults of the |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 def fetch_pkg_file(self, filename, dest_path): | 101 def fetch_pkg_file(self, filename, dest_path): |
102 if os.path.exists(dest_path): | 102 if os.path.exists(dest_path): |
103 os.remove(dest_path) | 103 os.remove(dest_path) |
104 logging.info('Fetching %s from autoserv to %s', filename, dest_path) | 104 logging.info('Fetching %s from autoserv to %s', filename, dest_path) |
105 self.job_harness.fetch_package(filename, dest_path) | 105 self.job_harness.fetch_package(filename, dest_path) |
106 if os.path.exists(dest_path): | 106 if os.path.exists(dest_path): |
107 logging.debug('Successfully fetched %s from autoserv', filename) | 107 logging.debug('Successfully fetched %s from autoserv', filename) |
108 else: | 108 else: |
109 raise error.PackageFetchError('%s not fetched from autoserv' | 109 raise error.PackageFetchError('%s not fetched from autoserv' |
110 % filename) | 110 % filename) |
OLD | NEW |