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:
Mike Place 2015-11-25 09:25:57 -07:00
commit cc69c87dd2

View File

@ -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'