Commit 047686c5 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Merge branch 'devel-2.3'



* devel-2.3:
  Remove unused import from client.gnt_instance
  gnt-instance console: Improve error reporting
  Increase timeout for connection on remote import
  import-export: Improve timeout error reporting

Conflicts:
	lib/cmdlib.py: Trivial
	lib/opcodes.py: Trivial
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parents 49e4c837 ab92578a
......@@ -267,10 +267,16 @@ def ProcessChildIO(child, socat_stderr_read_fd, dd_stderr_read_fd,
timeout = None
if listen_timeout and not exit_timeout:
assert mode == constants.IEM_IMPORT and options.connect_timeout
if status_file.GetConnected():
listen_timeout = None
elif listen_timeout.Remaining() < 0:
logging.info("Child process didn't establish connection in time")
errmsg = ("Child process didn't establish connection in time"
" (%0.0fs), sending SIGTERM" % options.connect_timeout)
logging.error(errmsg)
status_file.AddRecentOutput(errmsg)
status_file.Update(True)
child.Kill(signal.SIGTERM)
exit_timeout = \
utils.RunningTimeout(constants.CHILD_LINGER_TIMEOUT, True)
......
......@@ -25,7 +25,6 @@
# W0614: Unused import %s from wildcard import (since we need cli)
# C0103: Invalid name gnt-instance
import os
import itertools
import simplejson
from cStringIO import StringIO
......@@ -892,12 +891,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