cmd-aws-replicate: make a variable default more idiomatic
@@ -69,7 +69,7 @@ def run_ore():
ore_args.extend(['--log-level', args.log_level])
ore_args.extend(['aws', 'copy-image', '--image', source_image, '--region', source_region])
- upload_failed_in_region = ""
+ upload_failed_in_region = None
for upload_region in region_list:
region_ore_args = ore_args.copy() + [upload_region]
print("+ {}".format(subprocess.list2cmdline(region_ore_args)))
@@ -89,7 +89,7 @@ def run_ore():
write_json(buildmeta_path, buildmeta)
print(f"Updated: {buildmeta_path}")
- if upload_failed_in_region != "":
+ if upload_failed_in_region is not None:
raise Exception(f"Upload failed in {upload_failed_in_region} region")
