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

Unified Diff: client/common_lib/cros/autoupdater.py

Issue 6312162: Support dev builds. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: Created 9 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/common_lib/cros/autoupdater.py
diff --git a/client/common_lib/cros/autoupdater.py b/client/common_lib/cros/autoupdater.py
index 3ed610509e80eee0dba9dca2f5f03ebc0d517826..244cbbdd117d6f9ec88c76f4f07641c2a52be77c 100644
--- a/client/common_lib/cros/autoupdater.py
+++ b/client/common_lib/cros/autoupdater.py
@@ -134,6 +134,8 @@ class ChromiumOSUpdater():
def check_version(self):
booted_version = self.get_build_id()
+ if not booted_version:
+ booted_version = self.get_dev_build_id()
if not booted_version in self.update_version:
logging.error('Expected Chromium OS version: %s.'
'Found Chromium OS %s',
@@ -147,19 +149,22 @@ class ChromiumOSUpdater():
def get_build_id(self):
"""Turns the CHROMEOS_RELEASE_DESCRIPTION into a string that
matches the build ID."""
- # TODO(seano): handle dev build naming schemes.
version = self._run('grep CHROMEOS_RELEASE_DESCRIPTION'
' /etc/lsb-release').stdout
build_re = (r'CHROMEOS_RELEASE_DESCRIPTION='
'(\d+\.\d+\.\d+\.\d+) \(\w+ \w+ (\w+)(.*)\)')
version_match = re.match(build_re, version)
- if not version_match:
- raise ChromiumOSError('Unable to get build ID from %s. Found "%s"',
- self.host.hostname, version)
- version, build_id, builder = version_match.groups()
- build_match = re.match(r'.*: (\d+)', builder)
- if build_match:
- builder_num = '-b%s' % build_match.group(1)
- else:
- builder_num = ''
- return '%s-r%s%s' % (version, build_id, builder_num)
+ if version_match:
+ version, build_id, builder = version_match.groups()
+ build_match = re.match(r'.*: (\d+)', builder)
+ if build_match:
+ builder_num = '-b%s' % build_match.group(1)
+ else:
+ builder_num = ''
+ return '%s-r%s%s' % (version, build_id, builder_num)
+
+
+ def get_dev_build_id(self):
+ """Pulls the CHROMEOS_RELEASE_VERSION string from /etc/lsb-release."""
+ return self._run('grep CHROMEOS_RELEASE_VERSION'
+ ' /etc/lsb-release').stdout.split('=')[1].strip()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698