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 parser = autoserv_parser.autoserv_parser | |
DaleCurtis
2011/04/21 21:51:02
Alphabetize config/parser.
ericli
2011/04/21 23:48:12
Done.
| |
7 config = global_config.global_config | |
3 | 8 |
DaleCurtis
2011/04/21 21:51:02
Two lines between top level.
ericli
2011/04/21 23:48:12
Done.
| |
4 class SiteAutotest(installable_object.InstallableObject): | 9 class SiteAutotest(installable_object.InstallableObject): |
5 | 10 |
6 def get(self, location = None): | 11 def get(self, location = None): |
7 if not location: | 12 if not location: |
8 location = os.path.join(self.serverdir, '../client') | 13 location = os.path.join(self.serverdir, '../client') |
9 location = os.path.abspath(location) | 14 location = os.path.abspath(location) |
10 installable_object.InstallableObject.get(self, location) | 15 installable_object.InstallableObject.get(self, location) |
11 self.got = True | 16 self.got = True |
12 | 17 |
13 | 18 |
19 def get_fetch_location(self): | |
20 if not parser.options.image: | |
21 return super(SiteAutotest, self).get_fetch_location() | |
22 | |
23 repos = config.get_config_value('PACKAGES', 'fetch_location', type=list, | |
24 default=[]) | |
25 new_repos = [] | |
26 for repo in repos[::-1]: | |
27 if repo.endswith('static/archive'): | |
28 path = parser.options.image.rstrip('/') | |
DaleCurtis
2011/04/21 21:51:02
No need to compute path or build in loop. Move the
ericli
2011/04/21 23:48:12
No, I would say only compute inside loop.
We will
| |
29 build = '/'.join(path.split('/')[-2:]) | |
30 repo += '/%s/autotest' % build | |
31 new_repos.append(repo) | |
32 return new_repos | |
33 | |
34 | |
14 class _SiteRun(object): | 35 class _SiteRun(object): |
15 pass | 36 pass |
OLD | NEW |