Skip to content

Commit

Permalink
Complete ansible#61752, check that the src is a directory
Browse files Browse the repository at this point in the history
Since mount can be used for NFS or others, checking the
path do not work for those.
  • Loading branch information
mscherer committed Sep 24, 2019
1 parent 7711524 commit 55bcb71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/modules/system/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ def main():

changed = True
elif state == 'mounted':
if not os.path.exists(args['src']):
if args['src'][0] == '/' and not os.path.exists(args['src']):
module.fail_json(msg="Unable to mount %s as it does not exist" % args['src'])

if not os.path.exists(name) and not module.check_mode:
Expand Down

0 comments on commit 55bcb71

Please sign in to comment.