mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #29112 from eliasp/ssh_known_hosts.present-backtrace-test
Prevent backtrace (KeyError) in `ssh_known_hosts.present` state
This commit is contained in:
commit
cc69c87dd2
@ -854,7 +854,7 @@ def check_known_host(user=None, hostname=None, key=None, fingerprint=None,
|
||||
|
||||
known_host = get_known_host(user, hostname, config=config, port=port)
|
||||
|
||||
if not known_host:
|
||||
if not known_host or 'fingerprint' not in known_host:
|
||||
return 'add'
|
||||
if key:
|
||||
return 'exists' if key == known_host['key'] else 'update'
|
||||
|
Loading…
Reference in New Issue
Block a user