fix crash due to permissions when clearing update staging dir (#21790)

old-commit-hash: 3a7444250cb8ac9b6315d76df240de6a4b9aec51
This commit is contained in:
Adeeb Shihadeh
2021-07-29 19:50:34 -07:00
committed by GitHub
parent 7461f1ff5a
commit 8b8e77575c

View File

@@ -167,6 +167,8 @@ def init_overlay() -> None:
params.put_bool("UpdateAvailable", False)
set_consistent_flag(False)
dismount_overlay()
if TICI:
run(["sudo", "rm", "-rf", STAGING_ROOT])
if os.path.isdir(STAGING_ROOT):
shutil.rmtree(STAGING_ROOT)