From 335d3315581d4b59137809b09b4edd7a850a706f Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 27 Sep 2016 07:47:41 -0700 Subject: Fix mount backport --- system/mount.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/system/mount.py b/system/mount.py index 7076d9fa..0428a9eb 100644 --- a/system/mount.py +++ b/system/mount.py @@ -351,6 +351,7 @@ def is_bind_mounted(module, dest, src=None, fstype=None): arguments = mnt.split() if get_platform().lower() == 'linux': + source = arguments[1] result = mount_pattern.search(arguments[1]) # This is only for LVM and tmpfs mounts @@ -361,6 +362,18 @@ def is_bind_mounted(module, dest, src=None, fstype=None): # That's for unmounted/absent if arguments[0] == dest: is_mounted = True + else: + # That's for mounted + if arguments[0] == dest and source == src: + is_mounted = True + elif arguments[0] == dest and src.endswith(source): + # Check if it's tmpfs mount + sub_path = src[:len(src)-len(source)] + + if ( + is_bind_mounted(module, sub_path, 'tmpfs') and + source == src[len(sub_path):]): + is_mounted = True elif ( (arguments[0] == src or src is None) and arguments[2] == dest and -- cgit v1.2.1