summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ironic/drivers/base.py3
-rw-r--r--ironic/tests/unit/drivers/test_base.py10
-rw-r--r--releasenotes/notes/async_bios_clean_step-7348efff3f6d02c1.yaml6
3 files changed, 14 insertions, 5 deletions
diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py
index 1c6a37609..a712cc43f 100644
--- a/ironic/drivers/base.py
+++ b/ironic/drivers/base.py
@@ -1039,8 +1039,9 @@ class BIOSInterface(BaseInterface):
def wrapper(func):
@six.wraps(func)
def wrapped(task, *args, **kwargs):
- func(task, *args, **kwargs)
+ result = func(task, *args, **kwargs)
instance.cache_bios_settings(task)
+ return result
return wrapped
for n, method in inspect.getmembers(instance, inspect.ismethod):
diff --git a/ironic/tests/unit/drivers/test_base.py b/ironic/tests/unit/drivers/test_base.py
index d3f736765..123381025 100644
--- a/ironic/tests/unit/drivers/test_base.py
+++ b/ironic/tests/unit/drivers/test_base.py
@@ -550,10 +550,10 @@ class MyBIOSInterface(driver_base.BIOSInterface):
pass
def apply_configuration(self, task, settings):
- pass
+ return "return_value_apply_configuration"
def factory_reset(self, task):
- pass
+ return "return_value_factory_reset"
def cache_bios_settings(self, task):
pass
@@ -566,16 +566,18 @@ class TestBIOSInterface(base.TestCase):
bios = MyBIOSInterface()
task_mock = mock.MagicMock()
- bios.apply_configuration(task_mock, "")
+ actual = bios.apply_configuration(task_mock, "")
cache_bios_settings_mock.assert_called_once_with(bios, task_mock)
+ self.assertEqual(actual, "return_value_apply_configuration")
@mock.patch.object(MyBIOSInterface, 'cache_bios_settings', autospec=True)
def test_factory_reset_wrapper(self, cache_bios_settings_mock):
bios = MyBIOSInterface()
task_mock = mock.MagicMock()
- bios.factory_reset(task_mock)
+ actual = bios.factory_reset(task_mock)
cache_bios_settings_mock.assert_called_once_with(bios, task_mock)
+ self.assertEqual(actual, "return_value_factory_reset")
class TestBootInterface(base.TestCase):
diff --git a/releasenotes/notes/async_bios_clean_step-7348efff3f6d02c1.yaml b/releasenotes/notes/async_bios_clean_step-7348efff3f6d02c1.yaml
new file mode 100644
index 000000000..bbe485001
--- /dev/null
+++ b/releasenotes/notes/async_bios_clean_step-7348efff3f6d02c1.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+ - |
+ Fixes the bug in executing asynchronous BIOS interface clean step by
+ honoring the state returned by the BIOS interface clean step which
+ was ignored earlier.