diff options
author | David Howells <dhowells@redhat.com> | 2014-06-25 16:08:16 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2014-06-25 16:16:13 +0100 |
commit | 2bf3cdc0ddd40e462468fb3d9088b3cae7d4cc53 (patch) | |
tree | a4a81b8463ff16c9f1e6098fc26c9d46e60d9637 | |
parent | 8413678a7d021d873d6325a80d34c238a0a5be31 (diff) |
Unmount previously mounted filesystems for overlayfs
Unmount previously mounted filesystems for overlayfs so as not to pin loads of
memory if the scripts are repeatedly run when they keep failing with an error.
-rw-r--r-- | set_up.py | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -22,7 +22,27 @@ def set_up(ctx): # union. if cfg.testing_unionmount(): try: - while system("umount " + cfg.union_mntroot()): + while system("umount " + cfg.union_mntroot() + " >&/dev/null"): + pass + except RuntimeError: + pass + + if cfg.testing_overlayfs(): + try: + while system("grep 'lower_layer " + lower_mntroot + "' /proc/mounts >/dev/null" + + " && umount " + lower_mntroot): + pass + except RuntimeError: + pass + try: + while system("grep 'upper_layer " + cfg.upper_mntroot() + "' /proc/mounts >/dev/null" + + " && umount " + cfg.upper_mntroot()): + pass + except RuntimeError: + pass + try: + while system("grep 'overlayfs " + cfg.union_mntroot() + "' /proc/mounts >/dev/null" + + " && umount " + cfg.union_mntroot()): pass except RuntimeError: pass |