Commit 678aa6d3 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

gnt-instance console: Improve error reporting



If the SSH command fails, this will give a more detailed error
message than before.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent eaf7d41d
......@@ -959,12 +959,12 @@ def ConnectToInstanceConsole(opts, args):
if opts.show_command:
ToStdout("%s", utils.ShellQuoteArgs(cmd))
else:
try:
os.execvp(cmd[0], cmd)
finally:
ToStderr("Can't run console command %s with arguments:\n'%s'",
cmd[0], " ".join(cmd))
os._exit(1) # pylint: disable-msg=W0212
result = utils.RunCmd(cmd, interactive=True)
if result.failed:
raise errors.OpExecError("Console command \"%s\" failed: %s" %
(utils.ShellQuoteArgs(cmd), result.fail_reason))
return constants.EXIT_SUCCESS
def _FormatLogicalID(dev_type, logical_id, roman):
......
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