X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/5bbd3f7f72506933b9ab86d2d1faff85ab3b4551..fc8a6b8f3334c1352caafcede1e31d801fc146ba:/lib/ssh.py?ds=sidebyside diff --git a/lib/ssh.py b/lib/ssh.py index f0362b4..e891314 100644 --- a/lib/ssh.py +++ b/lib/ssh.py @@ -227,7 +227,12 @@ class SshRunner: remotehostname = retval.stdout.strip() if not remotehostname or remotehostname != node: - return False, "hostname mismatch, got %s" % remotehostname + if node.startswith(remotehostname + "."): + msg = "hostname not FQDN" + else: + msg = "hostname mistmatch" + return False, ("%s: expected %s but got %s" % + (msg, node, remotehostname)) return True, "host matches"