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

Unified Diff: src/platform/dev/autoupdate.py

Issue 2392002: Quiet down stateful_update & add timeout for downloads. (Closed) Base URL: ssh://git@chromiumos-git//chromeos
Patch Set: fixes to autoupdate to work with memento_updater and autotest. Created 10 years, 7 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
« no previous file with comments | « no previous file | src/platform/dev/stateful_update » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/dev/autoupdate.py
diff --git a/src/platform/dev/autoupdate.py b/src/platform/dev/autoupdate.py
index c541f6a13a70c3bdefa9414fc6ab5e2e7fe1a193..93d6b0d194841ba1b2ff226f7681dbceddc3a7fd 100644
--- a/src/platform/dev/autoupdate.py
+++ b/src/platform/dev/autoupdate.py
@@ -20,6 +20,7 @@ class Autoupdate(BuildObject):
*args, **kwargs):
super(Autoupdate, self).__init__(*args, **kwargs)
self.serve_only = serve_only
+ self.factory_config = factory_config_path
self.test_image = test_image
self.static_urlbase = urlbase
if serve_only:
@@ -28,13 +29,12 @@ class Autoupdate(BuildObject):
# link to the build archive.
web.debug('Autoupdate in "serve update images only" mode.')
if os.path.exists('static/archive'):
- archive_symlink = os.readlink('static/archive')
- if archive_symlink != self.static_dir:
+ if self.static_dir != os.readlink('static/archive'):
web.debug('removing stale symlink to %s' % self.static_dir)
os.unlink('static/archive')
+ os.symlink(self.static_dir, 'static/archive')
else:
- os.symlink(self.static_dir, 'static/archive')
- self.factory_config = None
+ os.symlink(self.static_dir, 'static/archive')
if factory_config_path is not None:
self.ImportFactoryConfigFile(factory_config_path, validate_factory_config)
@@ -107,7 +107,11 @@ class Autoupdate(BuildObject):
if os.path.exists(image):
return True
else:
- return os.system('cd %s && unzip -o image.zip %s unpack_partitions.sh' %
+ # -n, never clobber an existing file, in case we get invoked
+ # simultaneously by multiple request handlers. This means that
+ # we're assuming each image.zip file lives in a versioned
+ # directory (a la Buildbot).
+ return os.system('cd %s && unzip -n image.zip %s unpack_partitions.sh' %
(image_path, image_file)) == 0
def GetImageBinPath(self, image_path):
« no previous file with comments | « no previous file | src/platform/dev/stateful_update » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698