ssh: more details on failure
authorIustin Pop <iustin@google.com>
Tue, 3 Feb 2009 10:55:19 +0000 (10:55 +0000)
committerIustin Pop <iustin@google.com>
Tue, 3 Feb 2009 10:55:19 +0000 (10:55 +0000)
In case we fail without output from the ssh command, we should at least
add the exit code or any other failure reason to the error message, and
log it and the cmdline used to the node daemon log.

Reviewed-by: imsnah

lib/ssh.py

index e87b19d..40df999 100644 (file)
@@ -219,6 +219,9 @@ class SshRunner:
       output = retval.output
       if output:
         msg += ": %s" % output
+      else:
+        msg += ": %s (no output)" % retval.fail_reason
+      logging.error("Command %s failed: %s" % (retval.cmd, msg))
       return False, msg
 
     remotehostname = retval.stdout.strip()