cros_build_lib.Die lazy formatting.
nitty fix: Switch calls to cros_build_lib.Die to use lazy formatting
rather than formatting the string being passed.
BUG=None
TEST=run_tests
Change-Id: Id8e3f5df94dd602eb2a431d73f4d84e04d5d2a02
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3964308
Reviewed-by: Ram Chandrasekar <rchandrasekar@google.com>
Commit-Queue: Alex Klein <saklein@chromium.org>
Tested-by: Alex Klein <saklein@chromium.org>
Auto-Submit: Alex Klein <saklein@chromium.org>
diff --git a/api/controller/payload.py b/api/controller/payload.py
index 545168c..1f68f21 100644
--- a/api/controller/payload.py
+++ b/api/controller/payload.py
@@ -64,7 +64,7 @@
try:
tgt_image = getattr(input_proto, tgt_name)
except AttributeError:
- cros_build_lib.Die("%s is not a known tgt image type" % (tgt_name,))
+ cros_build_lib.Die("%s is not a known tgt image type", tgt_name)
# Resolve the src image oneof.
src_name = input_proto.WhichOneof("src_image_oneof")
@@ -77,19 +77,20 @@
try:
src_image = getattr(input_proto, src_name)
except AttributeError:
- cros_build_lib.Die("%s is not a known src image type" % (src_name,))
+ cros_build_lib.Die("%s is not a known src image type", src_name)
# Ensure they are compatible oneofs.
if (src_name, tgt_name) not in _VALID_IMAGE_PAIRS:
cros_build_lib.Die(
- "%s and %s are not valid image pairs" % (src_image, tgt_image)
+ "%s and %s are not valid image pairs", src_image, tgt_image
)
# Ensure that miniOS payloads are only requested for compatible image types.
if input_proto.minios and (src_name, tgt_name) not in _VALID_MINIOS_PAIRS:
cros_build_lib.Die(
- "%s and %s are not valid image pairs for miniOS"
- % (src_image, tgt_image)
+ "%s and %s are not valid image pairs for miniOS",
+ src_image,
+ tgt_image,
)
# Find the value of bucket or default to 'chromeos-releases'.