Commit 953dc6b3 by Rob Smith

When not finding a host in ~/.ssh/known_hosts, the return value is 0 if the host…

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.
parent 24f11168
...@@ -40,8 +40,7 @@ def check_hostkey(module, fqdn): ...@@ -40,8 +40,7 @@ def check_hostkey(module, fqdn):
this_cmd = keygen_cmd + " -H -F " + fqdn this_cmd = keygen_cmd + " -H -F " + fqdn
rc, out, err = module.run_command(this_cmd) rc, out, err = module.run_command(this_cmd)
if rc == 0: if rc == 0 and out != "":
if out != "":
result = True result = True
else: else:
# Check the main system location # Check the main system location
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment