[autotest] Remove archive from the devserver url patterns.
TEST=Ran a suite with a reimage job on a DUT with the old
style job_repo_url.
BUG=chromium:214373
Change-Id: I5ad66022a464ca7352fe2fb1583942e3b885d5ba
Reviewed-on: https://gerrit.chromium.org/gerrit/62949
Commit-Queue: Prashanth Balasubramanian <beeps@chromium.org>
Reviewed-by: Prashanth Balasubramanian <beeps@chromium.org>
Tested-by: Prashanth Balasubramanian <beeps@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):