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 /ironic/drivers/modules/deploy_utils.py | |
parent | baccf3fb6af29a98d285ab19135b33bab3d3a69d (diff) | |
parent | 054825834ad23450af9d1ae83bdbbe3dc059ac7c (diff) | |
download | ironic-22461e4b416acc9e58c9b0cbc5eea4fd0f9d60a2.tar.gz |
Merge "Nit fixes for boot_mode being overwritten"
Diffstat (limited to 'ironic/drivers/modules/deploy_utils.py')
-rw-r--r-- | ironic/drivers/modules/deploy_utils.py | 19 |
1 files changed, 9 insertions, 10 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 |