Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: server/site_autotest.py

Issue 6883099: Enable autotest client package fetching based on updated image. (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« client/common_lib/site_packages.py ('K') | « client/common_lib/site_packages.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/site_autotest.py
diff --git a/server/site_autotest.py b/server/site_autotest.py
index 1709b280fa61ce0543a2011876913ace2a950873..f1fc0a267a398d96cfb6e9328f5799df9e2e2e59 100755
--- a/server/site_autotest.py
+++ b/server/site_autotest.py
@@ -1,5 +1,10 @@
-import os
-from autotest_lib.server import installable_object
+import os, urlparse
+from autotest_lib.client.common_lib import global_config
+from autotest_lib.server import autoserv_parser, installable_object
+
+
+parser = autoserv_parser.autoserv_parser
+
class SiteAutotest(installable_object.InstallableObject):
@@ -11,5 +16,20 @@ class SiteAutotest(installable_object.InstallableObject):
self.got = True
+ def get_fetch_location(self):
+ c = global_config.global_config
DaleCurtis 2011/04/21 19:16:55 You only use this once, might as well combine with
+ repos = c.get_config_value("PACKAGES", 'fetch_location', type=list,
DaleCurtis 2011/04/21 19:16:55 Single quotes.
+ default=[])
+ new_repos = []
+ for repo in repos[::-1]:
+ if repo.endswith('static/archive') and parser.options.image:
+ build = '/'.join(urlparse.urlparse(
DaleCurtis 2011/04/21 19:16:55 No real reason for the urlparse. [-2:] will return
+ parser.options.image).path.split('/')[-2:])
+ repo += '/' + build + '/autotest'
DaleCurtis 2011/04/21 19:16:55 '/%s/autotest' % build
+ new_repos.append(repo)
+ repos = new_repos
DaleCurtis 2011/04/21 19:16:55 Just "return new_repos"
+ return repos
+
+
class _SiteRun(object):
pass
« client/common_lib/site_packages.py ('K') | « client/common_lib/site_packages.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698