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.

pull/5695/head
Rob Smith 11 years ago
parent 24f11168d9
commit 953dc6b345

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

Loading…
Cancel
Save