From a75bef5bc6ae3ca23e312f9aec9c56b31811f4d0 Mon Sep 17 00:00:00 2001 From: Jonathan Mainguy Date: Mon, 29 Sep 2014 20:09:32 -0400 Subject: [PATCH] Fixes bind mounts Fixed tab's and spaces, or so I think I did Fixed tabs and spaces for real this time --- system/mount.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/system/mount.py b/system/mount.py index 9dc6fbe7b8c..d1104b361e1 100644 --- a/system/mount.py +++ b/system/mount.py @@ -320,6 +320,17 @@ def main(): if os.path.ismount(name): if changed: 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: changed = True res,msg = mount(module, **args)