mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Fix issue when the .ssh dir is not present
This commit is contained in:
parent
adaf07edaf
commit
5799b9034a
@ -216,7 +216,8 @@ def set_auth_key(
|
||||
enc,
|
||||
comment,
|
||||
options)
|
||||
open(
|
||||
os.path.join(uinfo['home'], config), 'a+').write(
|
||||
'\n{0}'.format(auth_line))
|
||||
fconfig = os.path.join(uinfo['home'], config)
|
||||
if not os.path.isdir(os.path.dirname(fconfig)):
|
||||
os.makedirs(os.path.dirname(fconfig))
|
||||
open(fconfig, 'a+').write('\n{0}'.format(auth_line))
|
||||
return 'new'
|
||||
|
Loading…
Reference in New Issue
Block a user