Reland "Store metadata about updates in a file alongside with payload."
Relands CL: I3695b0903514eb6840e88810b8546fdca690819e
This original CL had an issue where we only generated metadata in the root
folder. This means updating twice using image_to_live with different images
would break updates.
I've fixed this in the second patch. Please compare P1 vs P2 as P1 is just
the re-landed version of I3695b0903514eb6840e88810b8546fdca690819e. I've
also fixed a bunch of pylint warnings that are now required per upload.
BUG=chromium-os:36990
TEST=Unittests on all changed code, pylint on all changed files, ran update
on x86-generic image using both the serve_only and generate latest workflows.
Ran autoupdate_EndToEndTest
Change-Id: I6bb65b23a34f071e388a4e522fb0fb42eae8781b
Reviewed-on: https://gerrit.chromium.org/gerrit/42271
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
diff --git a/common_util.py b/common_util.py
index ec4c31b..55a95ff 100644
--- a/common_util.py
+++ b/common_util.py
@@ -23,8 +23,8 @@
# Module-local log function.
-def _Log(message, *args, **kwargs):
- return log_util.LogWithTag('UTIL', message, *args, **kwargs)
+def _Log(message, *args):
+ return log_util.LogWithTag('UTIL', message, *args)
AU_BASE = 'au'
@@ -87,7 +87,7 @@
else:
mton_payload_url = '/'.join([archive_url, payload])
elif build_artifact.FIRMWARE_ARCHIVE in payload:
- firmware_payload_url = '/'.join([archive_url, payload])
+ firmware_payload_url = '/'.join([archive_url, payload])
if not full_payload_url:
raise CommonUtilError(
@@ -204,7 +204,7 @@
to_wait_list = ['_full_', build_artifact.AUTOTEST_PACKAGE]
err_str = 'full payload or autotest tarball'
uploaded_list = WaitUntilAvailable(to_wait_list, archive_url, err_str,
- timeout=600)
+ timeout=timeout, delay=delay)
# First we gather the urls/paths for the update payloads.
full_url, nton_url, mton_url, fw_url = ParsePayloadList(
@@ -229,8 +229,8 @@
mton_url, main_staging_dir, mton_payload))
if fw_url:
- artifacts.append(build_artifact.BuildArtifact(
- fw_url, main_staging_dir, build_dir))
+ artifacts.append(build_artifact.BuildArtifact(
+ fw_url, main_staging_dir, build_dir))
# Gather information about autotest tarballs. Use autotest.tar if available.
if build_artifact.AUTOTEST_PACKAGE in uploaded_list:
@@ -531,6 +531,9 @@
return os.path.getsize(file_path)
+# Hashlib is strange and doesn't actually define these in a sane way that
+# pylint can find them. Disable checks for them.
+# pylint: disable=E1101,W0106
def GetFileHashes(file_path, do_sha1=False, do_sha256=False, do_md5=False):
"""Computes and returns a list of requested hashes.