mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
This commit is contained in:
@@ -218,7 +218,13 @@ def set_mount(module, args):
|
||||
) = line.split()
|
||||
|
||||
# Check if we found the correct line
|
||||
if ld['name'] != escaped_args['name']:
|
||||
if (
|
||||
ld['name'] != escaped_args['name'] or (
|
||||
# In the case of swap, check the src instead
|
||||
'src' in args and
|
||||
ld['name'] == 'none' and
|
||||
ld['fstype'] == 'swap' and
|
||||
ld['src'] != args['src'])):
|
||||
to_write.append(line)
|
||||
|
||||
continue
|
||||
@@ -299,7 +305,13 @@ def unset_mount(module, args):
|
||||
ld['passno']
|
||||
) = line.split()
|
||||
|
||||
if ld['name'] != escaped_name:
|
||||
if (
|
||||
ld['name'] != escaped_name or (
|
||||
# In the case of swap, check the src instead
|
||||
'src' in args and
|
||||
ld['name'] == 'none' and
|
||||
ld['fstype'] == 'swap' and
|
||||
ld['src'] != args['src'])):
|
||||
to_write.append(line)
|
||||
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user