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

Merge pull request #8180 from sergevanginderachter/empty_nfs_mount_path

mount module: execute the mount only after path validation
This commit is contained in:
Michael DeHaan 2014-08-08 11:18:25 -04:00
commit 5c46a39ca9

View file

@ -307,7 +307,6 @@ def main():
module.exit_json(changed=changed, **args)
if state in ['mounted', 'present']:
name, changed = set_mount(**args)
if state == 'mounted':
if not os.path.exists(name):
try:
@ -315,6 +314,8 @@ def main():
except (OSError, IOError), e:
module.fail_json(msg="Error making dir %s: %s" % (name, str(e)))
name, changed = set_mount(**args)
if state == 'mounted':
res = 0
if os.path.ismount(name):
if changed: