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

Fixes bind mounts

Fixed tab's and spaces, or so I think I did

Fixed tabs and spaces for real this time
This commit is contained in:
Jonathan Mainguy 2014-09-29 20:09:32 -04:00 committed by Matt Clay
parent 6be46cb2e3
commit aef138107c

View file

@ -320,6 +320,17 @@ def main():
if os.path.ismount(name): if os.path.ismount(name):
if changed: if changed:
res,msg = mount(module, **args) res,msg = mount(module, **args)
elif "bind" in args['opts']:
changed = True
cmd = 'mount -l'
rc, out, err = module.run_command(cmd)
allmounts = out.split('\n')
for mounts in allmounts[:-1]:
arguments = mounts.split()
if arguments[0] == args['src'] and arguments[2] == args['name'] and arguments[4] == args['fstype']:
changed = False
if changed:
res,msg = mount(module, **args)
else: else:
changed = True changed = True
res,msg = mount(module, **args) res,msg = mount(module, **args)