Commit 46f9a948 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Change qa_utils.ResolveInstanceName to take name



… instead of an object. Allows it to be used in places where
only the name is available.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 2cc8bdd0
......@@ -131,7 +131,7 @@ def TestInstanceAutomaticRestart(node, instance):
"""
master = qa_config.GetMasterNode()
inst_name = qa_utils.ResolveInstanceName(instance)
inst_name = qa_utils.ResolveInstanceName(instance["name"])
_ResetWatcherDaemon()
_XmShutdownInstance(node, inst_name)
......@@ -152,7 +152,7 @@ def TestInstanceConsecutiveFailures(node, instance):
"""
master = qa_config.GetMasterNode()
inst_name = qa_utils.ResolveInstanceName(instance)
inst_name = qa_utils.ResolveInstanceName(instance["name"])
_ResetWatcherDaemon()
......
......@@ -287,7 +287,7 @@ def TestInstanceExport(instance, node):
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
return qa_utils.ResolveInstanceName(instance)
return qa_utils.ResolveInstanceName(instance["name"])
def TestInstanceExportWithRemove(instance, node):
......@@ -340,7 +340,7 @@ def _TestInstanceDiskFailure(instance, node, node2, onmaster):
master = qa_config.GetMasterNode()
sq = utils.ShellQuoteArgs
instance_full = qa_utils.ResolveInstanceName(instance)
instance_full = qa_utils.ResolveInstanceName(instance["name"])
node_full = qa_utils.ResolveNodeName(node)
node2_full = qa_utils.ResolveNodeName(node2)
......
......@@ -209,8 +209,11 @@ def _ResolveName(cmd, key):
def ResolveInstanceName(instance):
"""Gets the full name of an instance.
@type instance: string
@param instance: Instance name
"""
return _ResolveName(['gnt-instance', 'info', instance['name']],
return _ResolveName(['gnt-instance', 'info', instance],
'Instance name')
......
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