Pass CONF proc weight to LPAR builder

Fix code to pass the configured uncapped_proc_weight to the
pypowervm VM standardizer.  Without this, it was defaulting
to the value in pypowervm versus the drivers CONF value
(which happened to be the same.)

Change-Id: I00cfc66612a59225558e9eff5636fe824a929566
This commit is contained in:
Kyle L. Henderson
2015-10-05 19:27:08 -05:00
parent bea9fb9cfa
commit 8b3d7578fb
2 changed files with 10 additions and 1 deletions

View File

@@ -59,6 +59,14 @@ class TestVMBuilder(test.TestCase):
self.host_w = mock.MagicMock()
self.lpar_b = vm.VMBuilder(self.host_w, self.adpt)
def test_conf_values(self):
# Test driver CONF values are passed to the standardizer
self.flags(uncapped_proc_weight=75, proc_units_factor=.25,
group='powervm')
lpar_bldr = vm.VMBuilder(self.host_w, self.adpt)
self.assertEqual(75, lpar_bldr.stdz.uncapped_weight)
self.assertEqual(.25, lpar_bldr.stdz.proc_units_factor)
def test_format_flavor(self):
"""Perform tests against _format_flavor."""
instance = objects.Instance(**powervm.TEST_INSTANCE)

View File

@@ -210,7 +210,8 @@ class VMBuilder(object):
self.adapter = adapter
self.host_w = host_w
self.stdz = lpar_bldr.DefaultStandardize(
self.host_w, proc_units_factor=CONF.powervm.proc_units_factor)
self.host_w, uncapped_weight=CONF.powervm.uncapped_proc_weight,
proc_units_factor=CONF.powervm.proc_units_factor)
def lpar_builder(self, instance, flavor):
"""Returns the pypowervm LPARBuilder for a given Nova flavor.