SCANNER: Add some error handling so we don't ouput an empty result

main
Micke Nordin 12 months ago
parent 4f219dab44
commit 03bebb9848
Signed by: micke
GPG Key ID: 0DA0A7A5708FE257

@ -143,10 +143,13 @@ if __name__ == "__main__":
os_hash = get_os_hash(image)
pkg_list = get_packages(image, os_hash)
inspect_data = get_inspect_data(image)
if os_hash == {} and pkg_list[0]['package']['version'] == None and inspect_data == []:
continue
result[image] = { "pkg_list": pkg_list }
result[image]["inspect_data"] = inspect_data
result[image]["os_hash"] = os_hash
cleanup_image(image)
cleanup_all()
print(json.dumps(result))
if result != {}:
print(json.dumps(result))

Loading…
Cancel
Save