buildextend-live: fix falsy check
`get_artifact_meta` returns an empty dict if the artifact is missing
rather than `None`. To be determined whether that's correct, though for
now at least let's fix these by just using good ol' Python boolean
coercion.
@@ -215,12 +215,12 @@ def generate_iso():
tmpisofile = os.path.join(tmpdir, iso_name)
img_metal_obj = buildmeta.get_artifact_meta("metal", unmerged=True)["images"].get("metal")
- if img_metal_obj is None:
+ if not img_metal_obj:
raise Exception("Live image generation requires `metal` image")
img_metal = os.path.join(builddir, img_metal_obj['path'])
img_metal_checksum = img_metal_obj['sha256']
img_metal4k_obj = buildmeta.get_artifact_meta("metal4k", unmerged=True)["images"].get("metal4k")
- if img_metal4k_obj is None:
+ if not img_metal4k_obj:
if not args.fast:
raise Exception("Live image generation requires `metal4k` image (use --fast to ignore)")
else:
@@ -276,7 +276,7 @@ def generate_iso():
run_verbose(['/usr/lib/coreos-assembler/osmet-pack',
img_metal, '512', tmp_osmet, img_metal_checksum,
'fast' if args.fast else 'normal'])
- if img_metal4k_obj is not None:
+ if img_metal4k_obj:
tmp_osmet4k = os.path.join(tmpinitrd_rootfs, img_metal4k_obj['path'] + '.osmet')
print('Generating osmet file for 4k metal image')
run_verbose(['/usr/lib/coreos-assembler/osmet-pack',
