Index: server/site_autotest.py |
diff --git a/server/site_autotest.py b/server/site_autotest.py |
index 1709b280fa61ce0543a2011876913ace2a950873..0a95e501d803501f60627f4d7e38285731cdeff7 100755 |
--- a/server/site_autotest.py |
+++ b/server/site_autotest.py |
@@ -1,5 +1,10 @@ |
import os |
-from autotest_lib.server import installable_object |
+from autotest_lib.client.common_lib import global_config |
+from autotest_lib.server import autoserv_parser, installable_object |
+ |
+ |
+parser = autoserv_parser.autoserv_parser |
DaleCurtis
2011/04/21 21:51:02
Alphabetize config/parser.
ericli
2011/04/21 23:48:12
Done.
|
+config = global_config.global_config |
DaleCurtis
2011/04/21 21:51:02
Two lines between top level.
ericli
2011/04/21 23:48:12
Done.
|
class SiteAutotest(installable_object.InstallableObject): |
@@ -11,5 +16,21 @@ class SiteAutotest(installable_object.InstallableObject): |
self.got = True |
+ def get_fetch_location(self): |
+ if not parser.options.image: |
+ return super(SiteAutotest, self).get_fetch_location() |
+ |
+ repos = config.get_config_value('PACKAGES', 'fetch_location', type=list, |
+ default=[]) |
+ new_repos = [] |
+ for repo in repos[::-1]: |
+ if repo.endswith('static/archive'): |
+ 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
|
+ build = '/'.join(path.split('/')[-2:]) |
+ repo += '/%s/autotest' % build |
+ new_repos.append(repo) |
+ return new_repos |
+ |
+ |
class _SiteRun(object): |
pass |