Move get_info to taking an instance.

This is a first step towards using uuids in this interface instead
of instance names (which are synonyms for instance ids).

Change-Id: I54b32a5020b0dbc21ba7156ed38ed188c483086b
This commit is contained in:
Michael Still 2012-02-22 12:30:37 +11:00
parent b87a238364
commit 40e20462b1
2 changed files with 4 additions and 3 deletions
nova
tests/baremetal
virt/baremetal

@ -282,7 +282,8 @@ class ProxyBareMetalTestCase(test.TestCase):
# Code under test
conn = proxy.get_connection(True)
info = conn.get_info('instance-00000001')
# TODO: this is not a very good fake instance
info = conn.get_info({'name': 'instance-00000001'})
# Expected values
self.assertEquals(info['mem'], 16777216)

@ -531,7 +531,7 @@ class ProxyConnection(driver.ComputeDriver):
LOG.debug(_('instance %s: finished toXML method'), instance['name'])
return xml_info
def get_info(self, instance_name):
def get_info(self, instance):
"""Retrieve information from baremetal for a specific instance name.
If a baremetal error is encountered during lookup, we might raise a
@ -539,7 +539,7 @@ class ProxyConnection(driver.ComputeDriver):
baremetal error is.
"""
_domain_info = self._conn.get_domain_info(instance_name)
_domain_info = self._conn.get_domain_info(instance['name'])
state, max_mem, mem, num_cpu, cpu_time = _domain_info
return {'state': state,
'max_mem': max_mem,