Allow async call to stage artifacts.
Add async argument to allow async call to stage artifacts. Default to False. In
async mode, client will poll devserver.is_staged method to check if artifacts
are staged.
BUG=chromium:249426
TEST=local devserver with link like:
http://localhost:8093/stage?archive_url=gs://chromeos-image-archive/lumpy-release/R30-4408.0.0/&artifacts=autotest,test_suites&async=True
http://localhost:8093/is_staged?archive_url=gs://chromeos-image-archive/lumpy-release/R28-4100.7.0&artifacts=autotest,test_suites
run_suite from local setup to stage a build that's not in the devserver.
Change-Id: I7777d5d25e8870fef7edf8a9084bca18f3624c46
Reviewed-on: https://gerrit.chromium.org/gerrit/64310
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
diff --git a/build_artifact.py b/build_artifact.py
index 2970ea1..a6a0c1c 100755
--- a/build_artifact.py
+++ b/build_artifact.py
@@ -94,7 +94,7 @@
"""
return name.replace('*', 'STAR').replace('.', 'DOT').replace('/', 'SLASH')
- def _ArtifactStaged(self):
+ def ArtifactStaged(self):
"""Returns True if artifact is already staged."""
return os.path.exists(os.path.join(self.install_dir, self.marker_name))
@@ -161,7 +161,7 @@
with self._process_lock:
common_util.MkDirP(self.install_dir)
- if not self._ArtifactStaged():
+ if not self.ArtifactStaged():
# If the artifact should already have been uploaded, don't waste
# cycles waiting around for it to exist.
timeout = 1 if no_wait else 10