mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
now mount/unmount are searched for instead of hardcoded
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
This commit is contained in:
@@ -197,12 +197,13 @@ def unset_mount(**kwargs):
|
|||||||
|
|
||||||
def mount(module, **kwargs):
|
def mount(module, **kwargs):
|
||||||
""" mount up a path or remount if needed """
|
""" mount up a path or remount if needed """
|
||||||
|
mount_bin = module.get_bin_path('mount')
|
||||||
|
|
||||||
name = kwargs['name']
|
name = kwargs['name']
|
||||||
if os.path.ismount(name):
|
if os.path.ismount(name):
|
||||||
cmd = [ '/bin/mount', '-o', 'remount', name ]
|
cmd = [ mount_bin , '-o', 'remount', name ]
|
||||||
else:
|
else:
|
||||||
cmd = [ '/bin/mount', name ]
|
cmd = [ mount_bin, name ]
|
||||||
|
|
||||||
rc, out, err = module.run_command(cmd)
|
rc, out, err = module.run_command(cmd)
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
@@ -213,8 +214,9 @@ def mount(module, **kwargs):
|
|||||||
def umount(module, **kwargs):
|
def umount(module, **kwargs):
|
||||||
""" unmount a path """
|
""" unmount a path """
|
||||||
|
|
||||||
|
umount_bin = module.get_bin_path('umount')
|
||||||
name = kwargs['name']
|
name = kwargs['name']
|
||||||
cmd = ['/bin/umount', name]
|
cmd = [umount_bin, name]
|
||||||
|
|
||||||
rc, out, err = module.run_command(cmd)
|
rc, out, err = module.run_command(cmd)
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user