diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py index 3c45437268..4862cabc53 100644 --- a/ironic/drivers/base.py +++ b/ironic/drivers/base.py @@ -953,7 +953,7 @@ class BIOSInterface(BaseInterface): def wrapper(func): @six.wraps(func) - def wrapped(self, task, *args, **kwargs): + def wrapped(task, *args, **kwargs): func(task, *args, **kwargs) instance.cache_bios_settings(task) return wrapped diff --git a/ironic/drivers/modules/fake.py b/ironic/drivers/modules/fake.py index 0167845642..62f9599492 100644 --- a/ironic/drivers/modules/fake.py +++ b/ironic/drivers/modules/fake.py @@ -246,6 +246,10 @@ class FakeBIOS(base.BIOSInterface): def validate(self, task): pass + @base.clean_step(priority=0, argsinfo={ + 'settings': {'description': ('List of BIOS settings, each item needs ' + 'to contain a dictionary with name/value pairs'), + 'required': True}}) def apply_configuration(self, task, settings): node_id = task.node.id try: @@ -253,6 +257,7 @@ class FakeBIOS(base.BIOSInterface): except exception.BIOSSettingAlreadyExists: objects.BIOSSettingList.save(task.context, node_id, settings) + @base.clean_step(priority=0) def factory_reset(self, task): node_id = task.node.id setting_objs = objects.BIOSSettingList.get_by_node_id( @@ -260,6 +265,7 @@ class FakeBIOS(base.BIOSInterface): for setting in setting_objs: objects.BIOSSetting.delete(task.context, node_id, setting.name) + @base.clean_step(priority=0) def cache_bios_settings(self, task): pass diff --git a/ironic/tests/unit/drivers/modules/test_noop.py b/ironic/tests/unit/drivers/modules/test_noop.py index 07919e4784..f1db0bdf76 100644 --- a/ironic/tests/unit/drivers/modules/test_noop.py +++ b/ironic/tests/unit/drivers/modules/test_noop.py @@ -36,10 +36,10 @@ class NoInterfacesTestCase(base.TestCase): def test_bios(self): self.assertRaises(exception.UnsupportedDriverExtension, getattr(noop.NoBIOS(), 'apply_configuration'), - self, self.task, '') + self.task, '') self.assertRaises(exception.UnsupportedDriverExtension, getattr(noop.NoBIOS(), 'factory_reset'), - self, self.task) + self.task) def test_console(self): for method in ('start_console', 'stop_console', 'get_console'): diff --git a/ironic/tests/unit/drivers/test_base.py b/ironic/tests/unit/drivers/test_base.py index b7494773e0..49a40f2c48 100644 --- a/ironic/tests/unit/drivers/test_base.py +++ b/ironic/tests/unit/drivers/test_base.py @@ -447,7 +447,7 @@ class TestBIOSInterface(base.TestCase): bios = MyBIOSInterface() task_mock = mock.MagicMock() - bios.apply_configuration(bios, task_mock, "") + bios.apply_configuration(task_mock, "") cache_bios_settings_mock.assert_called_once_with(bios, task_mock) @mock.patch.object(MyBIOSInterface, 'cache_bios_settings', autospec=True) @@ -455,7 +455,7 @@ class TestBIOSInterface(base.TestCase): bios = MyBIOSInterface() task_mock = mock.MagicMock() - bios.factory_reset(bios, task_mock) + bios.factory_reset(task_mock) cache_bios_settings_mock.assert_called_once_with(bios, task_mock)