summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDao Cong Tien <tiendc@vn.fujitsu.com>2018-07-27 09:59:24 +0700
committerDao Cong Tien <tiendc@vn.fujitsu.com>2018-07-27 09:59:24 +0700
commitf4eaaf72a62bc302a26c8e4799a33f5c2b9c8515 (patch)
treed8d4685d758b51e7fb8f23378298f599120a7c23
parent39b594369d60739c25e9bd10c44790adf92844b4 (diff)
downloadironic-f4eaaf72a62bc302a26c8e4799a33f5c2b9c8515.tar.gz
Fix for failure of cleaning for iRMC restore_bios_config
Due to the bug [1], when there is an in-band clean step follows an out-of-band one, an error will happen if server is rebooted by the OOB. This is fix for iRMC clean step restore_bios_config. [1] https://storyboard.openstack.org/#!/story/2002731 Change-Id: I2d4eecc43aca532604b3db8a11c8f14e5e62b5e6
-rw-r--r--ironic/drivers/modules/irmc/management.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/ironic/drivers/modules/irmc/management.py b/ironic/drivers/modules/irmc/management.py
index bddb97090..f938df293 100644
--- a/ironic/drivers/modules/irmc/management.py
+++ b/ironic/drivers/modules/irmc/management.py
@@ -168,10 +168,15 @@ def _restore_bios_config(task):
'as the backup data not found.', node_uuid)
return
- def _remove_bios_config(task):
+ def _remove_bios_config(task, reboot_flag=False):
"""Remove backup bios config from the node."""
internal_info = task.node.driver_internal_info
internal_info.pop('irmc_bios_config', None)
+ # NOTE(tiendc): If reboot flag is raised, then the BM will
+ # reboot and cause a bug if the next clean step is in-band.
+ # See https://storyboard.openstack.org/#!/story/2002731
+ if reboot_flag:
+ internal_info['cleaning_reboot'] = True
task.node.driver_internal_info = internal_info
task.node.save()
@@ -192,7 +197,7 @@ def _restore_bios_config(task):
error=e)
# Remove the backup data after restoring
- _remove_bios_config(task)
+ _remove_bios_config(task, reboot_flag=True)
LOG.info('BIOS config is restored successfully on node %s',
node_uuid)