Merge "Fix wrong message of invalid boot "enabled" parameter"

This commit is contained in:
Zuul 2018-03-23 22:24:53 +00:00 committed by Gerrit Code Review
commit 1b88123312
2 changed files with 9 additions and 5 deletions

View File

@ -214,7 +214,7 @@ class System(base.ResourceBase):
if enabled not in sys_maps.BOOT_SOURCE_ENABLED_MAP_REV:
raise exceptions.InvalidParameterValueError(
parameter='enabled', value=enabled,
valid_values=list(sys_maps.BOOT_SOURCE_TARGET_MAP_REV))
valid_values=list(sys_maps.BOOT_SOURCE_ENABLED_MAP_REV))
data = {
'Boot': {

View File

@ -213,10 +213,14 @@ class SystemTestCase(base.TestCase):
'invalid-target')
def test_set_system_boot_source_invalid_enabled(self):
self.assertRaises(exceptions.InvalidParameterValueError,
self.sys_inst.set_system_boot_source,
sushy.BOOT_SOURCE_TARGET_HDD,
enabled='invalid-enabled')
with self.assertRaisesRegex(
exceptions.InvalidParameterValueError,
'"enabled" value.*{0}'.format(
list(sys_map.BOOT_SOURCE_ENABLED_MAP_REV))):
self.sys_inst.set_system_boot_source(
sushy.BOOT_SOURCE_TARGET_HDD,
enabled='invalid-enabled')
def test__get_processor_collection_path_missing_processors_attr(self):
self.sys_inst._json.pop('Processors')