diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-04-10 10:20:00 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-04-10 10:20:00 +0000 |
commit | 22461e4b416acc9e58c9b0cbc5eea4fd0f9d60a2 (patch) | |
tree | 02e080e90852d23a4b14b953ec1f7d07d1f64d08 | |
parent | baccf3fb6af29a98d285ab19135b33bab3d3a69d (diff) | |
parent | 054825834ad23450af9d1ae83bdbbe3dc059ac7c (diff) | |
download | ironic-22461e4b416acc9e58c9b0cbc5eea4fd0f9d60a2.tar.gz |
Merge "Nit fixes for boot_mode being overwritten"
-rw-r--r-- | ironic/drivers/modules/deploy_utils.py | 19 | ||||
-rw-r--r-- | ironic/drivers/modules/ilo/common.py | 2 | ||||
-rw-r--r-- | ironic/drivers/modules/ilo/deploy.py | 4 | ||||
-rw-r--r-- | ironic/drivers/modules/iscsi_deploy.py | 2 |
4 files changed, 13 insertions, 14 deletions
diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py index 79fcaecd3..e6c2c48ef 100644 --- a/ironic/drivers/modules/deploy_utils.py +++ b/ironic/drivers/modules/deploy_utils.py @@ -1046,24 +1046,22 @@ def is_secure_boot_requested(node): def get_boot_mode_for_deploy(node): """Returns the boot mode that would be used for deploy. - This method returns boot mode to used for deploy using following order: + This method returns boot mode to be used for deploy. It returns 'uefi' if 'secure_boot' is set to 'true' in 'instance_info/capabilities' of node. - It returns value of 'boot_mode' in 'properties/capabilities' of node. - It returns boot mode specified in 'instance_info/deploy_boot_mode' of - node. + Otherwise it returns value of 'boot_mode' in 'properties/capabilities' + of node if set. If that is not set, it returns boot mode in + 'instance_info/deploy_boot_mode' for the node. It would return None if boot mode is present neither in 'capabilities' of - node 'properties' nor in node's 'instance_info'. + node 'properties' nor in node's 'instance_info' (which could also be None). :param node: an ironic node object. :returns: 'bios', 'uefi' or None """ if is_secure_boot_requested(node): - boot_mode = 'uefi' - LOG.debug('Deploy boot mode is %(boot_mode)s for %(node)s.', - {'boot_mode': boot_mode, 'node': node.uuid}) - return boot_mode + LOG.debug('Deploy boot mode is uefi for %s.', node.uuid) + return 'uefi' boot_mode = driver_utils.get_node_capability(node, 'boot_mode') if boot_mode is None: @@ -1072,4 +1070,5 @@ def get_boot_mode_for_deploy(node): LOG.debug('Deploy boot mode is %(boot_mode)s for %(node)s.', {'boot_mode': boot_mode, 'node': node.uuid}) - return boot_mode + + return boot_mode.lower() if boot_mode else boot_mode diff --git a/ironic/drivers/modules/ilo/common.py b/ironic/drivers/modules/ilo/common.py index 02085ea5d..1d1363d0d 100644 --- a/ironic/drivers/modules/ilo/common.py +++ b/ironic/drivers/modules/ilo/common.py @@ -348,7 +348,7 @@ def update_boot_mode(task): if boot_mode is not None: LOG.debug("Node %(uuid)s boot mode is being set to %(boot_mode)s", {'uuid': node.uuid, 'boot_mode': boot_mode}) - set_boot_mode(node, boot_mode.lower()) + set_boot_mode(node, boot_mode) return LOG.debug("Check pending boot mode for node %s.", node.uuid) diff --git a/ironic/drivers/modules/ilo/deploy.py b/ironic/drivers/modules/ilo/deploy.py index dbd9d7340..86dc0c729 100644 --- a/ironic/drivers/modules/ilo/deploy.py +++ b/ironic/drivers/modules/ilo/deploy.py @@ -335,8 +335,8 @@ def _prepare_node_for_deploy(task): if change_boot_mode: ilo_common.update_boot_mode(task) else: - # Need to update boot mode that would used during deploy, if one is not - # provided. + # Need to update boot mode that will be used during deploy, if one is + # not provided. # Since secure boot was disabled, we are in 'uefi' boot mode. if deploy_utils.get_boot_mode_for_deploy(task.node) is None: instance_info = task.node.instance_info diff --git a/ironic/drivers/modules/iscsi_deploy.py b/ironic/drivers/modules/iscsi_deploy.py index 220e204a3..ac7315d33 100644 --- a/ironic/drivers/modules/iscsi_deploy.py +++ b/ironic/drivers/modules/iscsi_deploy.py @@ -422,7 +422,7 @@ def _get_boot_mode(node): """ boot_mode = deploy_utils.get_boot_mode_for_deploy(node) if boot_mode: - return boot_mode.lower() + return boot_mode return "bios" |