Create the .ssh dir if it does not already exist.

reviewable/pr18780/r1
Michael DeHaan 12 years ago
parent ce26095967
commit ccb5bd3ecf

@ -129,6 +129,9 @@ def keyfile(module, user, write=False, path=None, manage_dir=True):
os.chmod(sshdir, 0700)
if not os.path.exists(keysfile):
basedir = os.path.dirname(keysfile)
if not os.path.exists(basedir):
os.makedirs(basedir)
try:
f = open(keysfile, "w") #touches file so we can set ownership and perms
finally:

Loading…
Cancel
Save