summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-02-06 10:59:20 -0600
committerGitHub <noreply@github.com>2024-02-06 10:59:20 -0600
commit9d74ae52092e97aa0ef285df4d44a5eb7ae93fbf (patch)
treeb60b52840ed696326736fa401966ce26c86eff0a /src
parent341fe08465cc6c5882164cc5ae0174353a2a492b (diff)
parentd80530c48a78dfeb55293494a257f6234b0ef76d (diff)
downloadvyos-1x-9d74ae52092e97aa0ef285df4d44a5eb7ae93fbf.tar.gz
vyos-1x-9d74ae52092e97aa0ef285df4d44a5eb7ae93fbf.zip
Merge pull request #2941 from jestabro/cleanup-wait
image-tools: T6016: wait for umount in cleanup function
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/image_installer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/op_mode/image_installer.py b/src/op_mode/image_installer.py
index 501e9b804..d677c2cf8 100755
--- a/src/op_mode/image_installer.py
+++ b/src/op_mode/image_installer.py
@@ -599,6 +599,8 @@ def cleanup(mounts: list[str] = [], remove_items: list[str] = []) -> None:
print('Unmounting target filesystems')
for mountpoint in mounts:
disk.partition_umount(mountpoint)
+ for mountpoint in mounts:
+ disk.wait_for_umount(mountpoint)
if remove_items:
print('Removing temporary files')
for remove_item in remove_items:
@@ -606,7 +608,8 @@ def cleanup(mounts: list[str] = [], remove_items: list[str] = []) -> None:
if Path(remove_item).is_file():
Path(remove_item).unlink()
if Path(remove_item).is_dir():
- rmtree(remove_item)
+ rmtree(remove_item, ignore_errors=True)
+
def cleanup_raid(details: raid.RaidDetails) -> None:
efiparts = []