1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

When not finding a host in ~/.ssh/known_hosts, the return value is 0 if the host just is not found. We then never check the system host file in /etc. This fixes the code to check /etc on any failure, not just a bad return code.

This commit is contained in:
Rob Smith 2014-01-20 18:56:39 -08:00
parent 24f11168d9
commit 953dc6b345

View file

@ -40,8 +40,7 @@ def check_hostkey(module, fqdn):
this_cmd = keygen_cmd + " -H -F " + fqdn
rc, out, err = module.run_command(this_cmd)
if rc == 0:
if out != "":
if rc == 0 and out != "":
result = True
else:
# Check the main system location