summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2016-11-23 13:21:26 -0800
committerBrian Coca <bcoca@users.noreply.github.com>2016-11-23 16:21:26 -0500
commit90a92f17fae8fab2a45da3ec1762a4bd489d8b0a (patch)
treec40d05953f448f9aeb77b74885308ed8abbc4b05
parentaa0cad528adcdc5cd3f69cb257ae54644090eb91 (diff)
downloadansible-modules-core-90a92f17fae8fab2a45da3ec1762a4bd489d8b0a.tar.gz
Force BSDs to use umount/mount instead of trying to use remount. (#5715)
* Force BSDs to use umount/mount instead of trying to use remount. Fixes #5591 * Initialize out and err
-rw-r--r--system/mount.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/system/mount.py b/system/mount.py
index b94752ff..1d7fa8ac 100644
--- a/system/mount.py
+++ b/system/mount.py
@@ -366,16 +366,26 @@ def remount(module, mount_bin, args):
cmd += _set_fstab_args(args)
cmd += [ args['name'], ]
+ out = err = ''
try:
- rc, out, err = module.run_command(cmd)
+ if get_platform().lower().endswith('bsd'):
+ # Note: Forcing BSDs to do umount/mount due to BSD remount not
+ # working as expected (suspect bug in the BSD mount command)
+ # Interested contributor could rework this to use mount options on
+ # the CLI instead of relying on fstab
+ # https://github.com/ansible/ansible-modules-core/issues/5591
+ rc = 1
+ else:
+ rc, out, err = module.run_command(cmd)
except:
rc = 1
+
if rc != 0:
- msg = out+err
+ msg = out + err
if ismount(args['name']):
rc, msg = umount(module, args['name'])
if rc == 0:
- rc,msg = mount(module, args)
+ rc, msg = mount(module, args)
return rc, msg
# Note if we wanted to put this into module_utils we'd have to get permission