-def _ResolveInstanceName(instance):
- """Gets the full Xen name of an instance.
-
- """
- master = qa_config.GetMasterNode()
-
- info_cmd = utils.ShellQuoteArgs(['gnt-instance', 'info', instance['name']])
- sed_cmd = utils.ShellQuoteArgs(['sed', '-n', '-e', 's/^Instance name: *//p'])
-
- cmd = '%s | %s' % (info_cmd, sed_cmd)
- ssh_cmd = qa_utils.GetSSHCommand(master['primary'], cmd)
- p = subprocess.Popen(ssh_cmd, shell=False, stdout=subprocess.PIPE)
- AssertEqual(p.wait(), 0)
-
- return p.stdout.read().strip()
-
-