Skip to content

Commit 366eee2

Browse files
committed
add unknown date and hash when
the relevant files are missing from the attack_data cache
1 parent ed2b4f8 commit 366eee2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

contentctl/objects/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,19 +361,19 @@ def check_test_data_caches(self) -> Self:
361361
# This is a cache that was built by contentctl. We can use this to
362362
# determine if the cache is out of date.
363363
with open(build_date_file, "r") as f:
364-
build_date = f"\n**Cache Build Date: {f.read().strip()}"
364+
build_date = f.read().strip()
365365
else:
366-
build_date = ""
366+
build_date = "<UNKNOWN_DATE>"
367367
if git_hash_file.is_file():
368368
# This is a cache that was built by contentctl. We can use this to
369369
# determine if the cache is out of date.
370370
with open(git_hash_file, "r") as f:
371-
git_hash = f"\n**Repo Git Hash : {f.read().strip()}"
371+
git_hash = f.read().strip()
372372
else:
373-
git_hash = ""
373+
git_hash = "<UNKNOWN_HASH>"
374374

375375
print(
376-
f"Found attack data cache at [{cache_path}]{build_date}{git_hash}\n"
376+
f"Found attack data cache at [{cache_path}]\n**Cache Build Date: {build_date}\n**Repo Git Hash : {git_hash}\n"
377377
)
378378

379379
return self

0 commit comments

Comments
 (0)