Determine flavor type from the public nova API.

Fixes bug 1078298

Previously the flavor name used in the flavor-specific instance meter
was available from the nova DB instance representation.

Now that we retrieve the on-host instances from the public nova
API as opposed to the DB, we need to retrieve and cache the flavor
name separately.

Change-Id: Ifd15eedd34e4128d5f9bdaa9318049e973dac9ed
This commit is contained in:
Eoghan Glynn
2012-11-13 14:01:58 +00:00
parent 171b1ce449
commit f3641de37f
3 changed files with 12 additions and 5 deletions

View File

@@ -59,8 +59,7 @@ class TestLibvirtBase(test_base.TestCase):
setattr(self.instance, 'OS-EXT-SRV-ATTR:instance_name',
self.instance.name)
self.instance.id = 1
self.instance.instance_type = mock.MagicMock()
self.instance.instance_type.name = 'm1.small'
self.instance.flavor = {'name': 'm1.small', 'id': 2}
flags.FLAGS.compute_driver = 'libvirt.LibvirtDriver'
flags.FLAGS.connection_type = 'libvirt'