Merge "Pass CONF proc weight to LPAR builder"

This commit is contained in:
Jenkins
2015-10-07 16:33:27 +00:00
committed by Gerrit Code Review
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.