updated: log git corruption (#2242)

* log git corruption

* better cloudlog
This commit is contained in:
Adeeb Shihadeh 2020-09-29 12:08:55 -07:00 committed by GitHub
parent 98fedff6b1
commit 3f40a9ee75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,6 +201,11 @@ def finalize_update() -> None:
shutil.rmtree(FINALIZED)
shutil.copytree(OVERLAY_MERGED, FINALIZED, symlinks=True)
# Log git repo corruption
fsck = run(["git", "fsck", "--no-progress"], FINALIZED).rstrip()
if len(fsck):
cloudlog.error(f"found git corruption, git fsck:\n{fsck}")
set_consistent_flag(True)
cloudlog.info("done finalizing overlay")