OLD | NEW |
1 import os | 1 import os |
2 from autotest_lib.server import installable_object | 2 from autotest_lib.client.common_lib import global_config |
| 3 from autotest_lib.server import autoserv_parser, installable_object |
| 4 |
| 5 |
| 6 config = global_config.global_config |
| 7 parser = autoserv_parser.autoserv_parser |
| 8 |
3 | 9 |
4 class SiteAutotest(installable_object.InstallableObject): | 10 class SiteAutotest(installable_object.InstallableObject): |
5 | 11 |
6 def get(self, location = None): | 12 def get(self, location = None): |
7 if not location: | 13 if not location: |
8 location = os.path.join(self.serverdir, '../client') | 14 location = os.path.join(self.serverdir, '../client') |
9 location = os.path.abspath(location) | 15 location = os.path.abspath(location) |
10 installable_object.InstallableObject.get(self, location) | 16 installable_object.InstallableObject.get(self, location) |
11 self.got = True | 17 self.got = True |
12 | 18 |
13 | 19 |
| 20 def get_fetch_location(self): |
| 21 if not parser.options.image: |
| 22 return super(SiteAutotest, self).get_fetch_location() |
| 23 |
| 24 repos = config.get_config_value('PACKAGES', 'fetch_location', type=list, |
| 25 default=[]) |
| 26 new_repos = [] |
| 27 for repo in repos[::-1]: |
| 28 if repo.endswith('static/archive'): |
| 29 path = parser.options.image.rstrip('/') |
| 30 build = '/'.join(path.split('/')[-2:]) |
| 31 repo += '/%s/autotest' % build |
| 32 new_repos.append(repo) |
| 33 return new_repos |
| 34 |
| 35 |
14 class _SiteRun(object): | 36 class _SiteRun(object): |
15 pass | 37 pass |
OLD | NEW |