Update devserver urls with /archive in autotest(2)
[autotest] Remove archive from the devserver url patterns.
Devserver is removing static/archive so that everything is served
straight from the static directory. Cutting out calls in autotest to
match.
BUG=chromium:214373
TEST=Ran a suite with a reimage job on a DUT with the old
style job_repo_url.
Change-Id: Id3e2e0559c82a5424ef50406c7360ce28ca9a337
Reviewed-on: https://gerrit.chromium.org/gerrit/62918
Reviewed-by: Prashanth Balasubramanian <beeps@chromium.org>
Commit-Queue: Joy Chen <joychen@chromium.org>
Reviewed-by: Joy Chen <joychen@chromium.org>
Tested-by: Joy Chen <joychen@chromium.org>
diff --git a/server/cros/dynamic_suite/tools.py b/server/cros/dynamic_suite/tools.py
index 52d82d2..47d5636 100644
--- a/server/cros/dynamic_suite/tools.py
+++ b/server/cros/dynamic_suite/tools.py
@@ -63,7 +63,14 @@
"""
pattern = package_url_pattern()
re_pattern = pattern.replace('%s', '(\S+)')
- return re.search(re_pattern, package_url).groups()
+
+ devserver_build_tuple = re.search(re_pattern, package_url).groups()
+
+ # TODO(beeps): This is a temporary hack around the fact that all
+ # job_repo_urls in the database currently contain 'archive'. Remove
+ # when all hosts have been reimaged at least once. Ref: crbug.com/214373.
+ return (devserver_build_tuple[0],
+ devserver_build_tuple[1].replace('archive/', ''))
def get_random_best_host(afe, host_list, require_usable_hosts=True):