Skip to content

Commit

Permalink
Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed Jun 2, 2022
1 parent c91c923 commit 1fca56e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,24 @@ def main(argv: Sequence[str]) -> None:
zzz_dir = os.path.join(_CHEF_ZZZ_ROOT, device)
device_zap_sha_file = os.path.join(zzz_dir, _CI_ZAP_MANIFEST_NAME)
device_md5_file = os.path.join(zzz_dir, _CI_DEVICE_MANIFEST_NAME)
help_msg = f"{device}: {fix_instructions}"
if not os.path.exists(device_zap_sha_file):
flush_print(f"ZAP MISSING {device}: {fix_instructions}")
flush_print(f"ZAP VERSION MISSING {help_msg}")
exit(1)
else:
with open(device_zap_sha_file, "r", encoding="utf-8") as zap_file:
output_cached_zap_sha = zap_file.read()
if output_cached_zap_sha != current_zap:
flush_print(f"ZAP MISMATCH {device}: {fix_instructions}")
flush_print(f"ZAP VERSION MISMATCH {help_msg}")
exit(1)
if not os.path.exists(device_md5_file):
flush_print(f"ZAP MD5 MISSING {device}: {fix_instructions}")
flush_print(f"INPUT MD5 MISSING {help_msg}")
exit(1)
else:
with open(device_md5_file, "r", encoding="utf-8") as md5_file:
output_cached_md5 = md5_file.read()
if output_cached_md5 != device_md5:
flush_print(f"ZAP MD5 MISMATCH {device}: {fix_instrucitons}")
flush_print(f"INPUT MD5 MISMATCH {help_msg}")
exit(1)
flush_print("Cached ZAP output is up to date!")
exit(0)
Expand Down

0 comments on commit 1fca56e

Please sign in to comment.