Commit 30989e69 authored by Alexander Schreiber's avatar Alexander Schreiber
Browse files

Internal API change for instance console access.

Change the internal hypervisor API for GetShellCommandForConsole, we
now call it with the instance instead of just the instance name.

This is a prep patch for HVM, since HVM needs more than just the instance
name to determine a way of console access.

(this is a resend due to mail adress tyop)

Reviewed-by: iustinp
parent 2584d4a4
......@@ -3143,7 +3143,7 @@ class LUConnectConsole(NoHooksLU):
logger.Debug("connecting to console of %s on %s" % (instance.name, node))
hyper = hypervisor.GetHypervisor()
console_cmd = hyper.GetShellCommandForConsole(instance.name)
console_cmd = hyper.GetShellCommandForConsole(instance)
# build ssh cmdline
argv = ["ssh", "-q", "-t"]
argv.extend(ssh.KNOWN_HOSTS_OPTS)
......
......@@ -110,7 +110,7 @@ class BaseHypervisor(object):
raise NotImplementedError
@staticmethod
def GetShellCommandForConsole(instance_name):
def GetShellCommandForConsole(instance):
"""Return a command for connecting to the console of an instance.
"""
......@@ -320,11 +320,11 @@ class XenHypervisor(BaseHypervisor):
return result
@staticmethod
def GetShellCommandForConsole(instance_name):
def GetShellCommandForConsole(instance):
"""Return a command for connecting to the console of an instance.
"""
return "xm console %s" % instance_name
return "xm console %s" % instance.name
def Verify(self):
......@@ -496,7 +496,7 @@ class FakeHypervisor(BaseHypervisor):
return result
@staticmethod
def GetShellCommandForConsole(instance_name):
def GetShellCommandForConsole(instance):
"""Return a command for connecting to the console of an instance.
"""
......
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