mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #21938 from rallytime/bp-21878
Backport #21878 to 2015.2
This commit is contained in:
commit
8977ed20c7
@ -258,7 +258,10 @@ def host_keys(keydir=None):
|
||||
kname += '.{0}'.format(top[1])
|
||||
try:
|
||||
with salt.utils.fopen(os.path.join(keydir, fn_), 'r') as _fh:
|
||||
keys[kname] = _fh.readline().strip()
|
||||
# As of RFC 4716 "a key file is a text file, containing a sequence of lines",
|
||||
# although some SSH implementations (e.g. OpenSSH) manage their own format(s).
|
||||
# Please see #20708 for a discussion about how to handle SSH key files in the future
|
||||
keys[kname] = _fh.read.strip()
|
||||
except (IOError, OSError):
|
||||
keys[kname] = ''
|
||||
return keys
|
||||
|
Loading…
Reference in New Issue
Block a user