summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoseph Bajin <josephbajin@gmail.com>2014-08-23 14:04:00 -0400
committerJoseph Bajin <josephbajin@gmail.com>2014-08-23 14:04:00 -0400
commit26e6c265277cf5e29b8af311f2bb8759b0e811cd (patch)
tree1e9ac09ea8493108ccc708bd4f5377f76c64a207 /cloudinit
parent7dbebd3fe9384ba90fce88cb715472d92e00e987 (diff)
downloadvyos-cloud-init-26e6c265277cf5e29b8af311f2bb8759b0e811cd.tar.gz
vyos-cloud-init-26e6c265277cf5e29b8af311f2bb8759b0e811cd.zip
Removed using lazy mode for umount
Safer for cloud-init to not use lazy mode for unmount
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/util.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 82d75843..6405db23 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1294,16 +1294,12 @@ def ensure_dir(path, mode=None):
@contextlib.contextmanager
-def unmounter(umount, lazy_support=True):
+def unmounter(umount):
try:
yield umount
finally:
if umount:
- # Do not use Lazy Mode on some systems (freebsd)
- if lazy_support:
- umount_cmd = ["umount", '-l', umount]
- else:
- umount_cmd = ["umount", umount]
+ umount_cmd = ["umount", umount]
subp(umount_cmd)
@@ -1386,12 +1382,7 @@ def mount_cb(device, callback, data=None, rw=False, mtype=None, sync=True):
# Be nice and ensure it ends with a slash
if not mountpoint.endswith("/"):
mountpoint += "/"
- # Set lazy_support to false if FreeBSD
- if device.startswith("/dev/cd"):
- lazy_support = False
- else:
- lazy_support = True
- with unmounter(umount, lazy_support):
+ with unmounter(umount):
if data is None:
ret = callback(mountpoint)
else: