Support secure_boot extra_spec in _format_flavor

This change enables the nova-powervm driver to accept the
'powervm:secure_boot' extra_spec and pass it down to pypowervm to
build the LPAR wrapper with.

Change-Id: I080065795778adee86c6cb37bcbf700a440d73b9
This commit is contained in:
Matt Rabe 2018-08-23 15:55:41 -04:00
parent b9338ee261
commit 362b705c16
4 changed files with 12 additions and 3 deletions

View File

@ -120,7 +120,7 @@ PyNaCl==1.2.1
pyOpenSSL==17.5.0
pyparsing==2.2.0
pyperclip==1.6.0
pypowervm==1.1.16
pypowervm==1.1.18
pyroute2==0.4.21
pytest==3.4.2
python-barbicanclient==4.5.2

View File

@ -232,11 +232,18 @@ class TestVMBuilder(test.NoDBTestCase):
self.assertRaises(exception.ValidationError,
self.lpar_b._format_flavor, instance)
# Test secure boot set
flavor.extra_specs = {'powervm:secure_boot': '2'}
test_attrs = dict(lpar_attrs, secure_boot='2')
self.assertEqual(self.lpar_b._format_flavor(instance), test_attrs)
# Prep for unsupported host tests
self.lpar_b.host_w.get_capability.return_value = False
# Test PPT ratio not set when rebuilding to non-supported host
flavor.extra_specs = {'powervm:ppt_ratio': '1:4096'}
instance.task_state = task_states.REBUILD_SPAWNING
test_attrs = dict(lpar_attrs)
self.lpar_b.host_w.get_capability.return_value = False
self.assertEqual(self.lpar_b._format_flavor(instance), test_attrs)
self.lpar_b.host_w.get_capability.assert_called_once_with(
'physical_page_table_ratio_capable')

View File

@ -161,6 +161,7 @@ class VMBuilder(object):
_PVM_SRR_CAPABILITY = 'powervm:srr_capability'
_PVM_PPT_RATIO = 'powervm:ppt_ratio'
_PVM_ENFORCE_AFFINITY_CHECK = 'powervm:enforce_affinity_check'
_PVM_SECURE_BOOT = 'powervm:secure_boot'
# Map of PowerVM extra specs to the lpar builder attributes.
# '' is used for attributes that are not implemented yet.
@ -180,6 +181,7 @@ class VMBuilder(object):
'powervm:enable_lpar_metric': lpar_bldr.ENABLE_LPAR_METRIC,
_PVM_PPT_RATIO: lpar_bldr.PPT_RATIO,
_PVM_ENFORCE_AFFINITY_CHECK: lpar_bldr.ENFORCE_AFFINITY_CHECK,
_PVM_SECURE_BOOT: lpar_bldr.SECURE_BOOT,
_PVM_UNCAPPED: None,
_PVM_DED_SHAR_MODE: None,
_PVM_PROC_COMPAT: None,

View File

@ -8,7 +8,7 @@ oslo.config>=5.2.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0
oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
oslo.utils>=3.37.0 # Apache-2.0
pypowervm>=1.1.16 # Apache-2.0
pypowervm>=1.1.18 # Apache-2.0
python-swiftclient>=3.2.0 # Apache-2.0
taskflow>=2.16.0 # Apache-2.0
setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0,>=21.0.0 # PSF/ZPL