Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed May 27, 2022
1 parent 7264515 commit 9421c27
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
_DEVICE_LIST = [file[:-4] for file in os.listdir(_DEVICE_FOLDER) if file.endswith(".zap")]
_CHEF_ZZZ_ROOT = os.path.join(_CHEF_SCRIPT_PATH, "zzz_generated")
_CI_MANIFEST_FILE_NAME = os.path.join(_CHEF_SCRIPT_PATH, "cimanifest.json")
_CI_DEVICE_MANIFEST_NAME = "INPUTMD5.txt"
_CICD_CONFIG_FILE_NAME = os.path.join(_CHEF_SCRIPT_PATH, "cicd_meta.json")
_CI_ALLOW_LIST = ["lighting-app"]

Expand Down Expand Up @@ -127,11 +128,11 @@ def generate_device_manifest(
device_file_md5 = hashlib.md5(device_file_data).hexdigest()
ci_manifest[device_name] = device_file_md5
print(f"Manifest for {device_name} : {device_file_md5}")
if write_manifest_file:
device_zzz_dir_root = os.path.join(_CHEF_ZZZ_ROOT, device_name)
device_zzz_md5_file = os.path.join(device_zzz_dir_root, 'INPUTMD5.txt')
with open(device_zzz_md5_file, "w+", encoding="utf-8") as md5file:
md5file.write(device_file_md5)
if write_manifest_file:
device_zzz_dir_root = os.path.join(_CHEF_ZZZ_ROOT, device_name)
device_zzz_md5_file = os.path.join(device_zzz_dir_root, _CI_DEVICE_MANIFEST_NAME)
with open(device_zzz_md5_file, "w+", encoding="utf-8") as md5file:
md5file.write(device_file_md5)
if include_zap_submod:
ci_manifest["zap_commit"] = check_zap_master(_REPO_BASE_PATH)
if write_manifest_file:
Expand Down Expand Up @@ -259,7 +260,7 @@ def main(argv: Sequence[str]) -> None:
exit(1)
else:
zzz_dir = os.path.join(_CHEF_ZZZ_ROOT, device)
device_md5_file = os.path.join(zzz_dir, "INPUTMD5.txt")
device_md5_file = os.path.join(zzz_dir, _CI_DEVICE_MANIFEST_NAME)
if not os.path.exists(device_md5_file):
print("MISSING RESULT - "+fix_instructions)
exit(1)
Expand Down

0 comments on commit 9421c27

Please sign in to comment.