firmware: report bundled artifacts.
Also, freshen python bindings.
BUG=b:177907747
TEST=CQ
Cq-Include-Trybots: chromeos/staging:staging-firmware-ec-cq
Cq-Depend: chromium:2686259
Change-Id: I5db50a81acffb62d294546b783c5a8345803307e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2686450
Tested-by: LaMont Jones <lamontjones@chromium.org>
Tested-by: Sean McAllister <smcallis@google.com>
Reviewed-by: Sean McAllister <smcallis@google.com>
diff --git a/api/controller/firmware.py b/api/controller/firmware.py
index 9557173..b8b8e7e 100644
--- a/api/controller/firmware.py
+++ b/api/controller/firmware.py
@@ -168,18 +168,27 @@
'bundle',
output_dir=tmpdir,
metadata=metadata_path)
- if input_proto.artifacts.FIRMWARE_TARBALL in info.artifact_types:
- # TODO(b/177907747): gather the paths from the response and add them to
- # out.paths.
- out = output_proto.artifacts.artifacts.add(
- artifact_type=input_proto.artifacts.FIRMWARE_TARBALL, paths=[])
- out.location = info.location
+ tarball_paths = []
if (input_proto.artifacts.FIRMWARE_TARBALL_INFO in info.artifact_types and
os.path.exists(metadata_path)):
+ with open(metadata_path, 'r') as f:
+ metadata = json_format.Parse(f.read(),
+ firmware_pb2.FirmwareArtifactInfo())
out = output_proto.artifacts.artifacts.add(
artifact_type=input_proto.artifacts.FIRMWARE_TARBALL_INFO,
paths=[
common_pb2.Path(
path=metadata_path, location=common_pb2.Path.INSIDE)
])
+ tarball_paths = [
+ common_pb2.Path(
+ path=os.path.join(tmpdir, x.file_name),
+ location=common_pb2.Path.INSIDE) for x in metadata.objects
+ ]
+ if (tarball_paths and
+ input_proto.artifacts.FIRMWARE_TARBALL in info.artifact_types):
+ out = output_proto.artifacts.artifacts.add(
+ artifact_type=input_proto.artifacts.FIRMWARE_TARBALL,
+ paths=tarball_paths)
+ out.location = info.location
return resp