Merge pull request #1651 from verm666/issue-1515

fix authorized_keys in check_mode
This commit is contained in:
Toshio Kuratomi 2015-07-01 07:52:48 -07:00
commit 1dc5074602

View file

@ -169,6 +169,13 @@ def keyfile(module, user, write=False, path=None, manage_dir=True):
:return: full path string to authorized_keys for user
"""
if module.check_mode:
if path is None:
module.fail_json(msg="You must provide full path to key file in check mode")
else:
keysfile = path
return keysfile
try:
user_entry = pwd.getpwnam(user)
except KeyError, e: