1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #3242 from bcoca/mount_findbin

now mount/unmount binaries are searched for instead of hardcoded
This commit is contained in:
Michael DeHaan 2013-06-17 20:31:12 -07:00
commit 6d19150bb1

View file

@ -197,12 +197,13 @@ def unset_mount(**kwargs):
def mount(module, **kwargs):
""" mount up a path or remount if needed """
mount_bin = module.get_bin_path('mount')
name = kwargs['name']
if os.path.ismount(name):
cmd = [ '/bin/mount', '-o', 'remount', name ]
cmd = [ mount_bin , '-o', 'remount', name ]
else:
cmd = [ '/bin/mount', name ]
cmd = [ mount_bin, name ]
rc, out, err = module.run_command(cmd)
if rc == 0:
@ -213,8 +214,9 @@ def mount(module, **kwargs):
def umount(module, **kwargs):
""" unmount a path """
umount_bin = module.get_bin_path('umount')
name = kwargs['name']
cmd = ['/bin/umount', name]
cmd = [umount_bin, name]
rc, out, err = module.run_command(cmd)
if rc == 0: