diff options
author | Serge van Ginderachter <serge@vanginderachter.be> | 2014-07-17 14:49:40 +0200 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2014-08-14 15:00:45 -0500 |
commit | 1dd484cc2df0257a1b24bb22aada001201e3fb3e (patch) | |
tree | 9525cbcc5299bc2de2a6815566f1cb21c233fc87 | |
parent | 31210084756c59fb2bb8dc3e7c259b895b8f128b (diff) | |
download | ansible-1dd484cc2df0257a1b24bb22aada001201e3fb3e.tar.gz |
execute the mount after path validation
This avoids a stale situation where name/path contains some impossible path,
but gets configured (faultly) in fstab, and the module only fails after that,
when creating that path.
-rwxr-xr-x | library/system/mount | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/system/mount b/library/system/mount index a886a04dbd..9dc6fbe7b8 100755 --- a/library/system/mount +++ b/library/system/mount @@ -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: |