diff options
author | Shivanand Tendulker <stendulker@gmail.com> | 2015-04-08 09:28:13 -0700 |
---|---|---|
committer | Shivanand Tendulker <stendulker@gmail.com> | 2015-04-09 01:38:16 -0700 |
commit | 054825834ad23450af9d1ae83bdbbe3dc059ac7c (patch) | |
tree | 388c6f92c97876e2705a1ad9876014603a9a9838 /ironic/drivers/modules/deploy_utils.py | |
parent | b7891ec7e677149bdbea72aaf292cdbec66b062b (diff) | |
download | ironic-054825834ad23450af9d1ae83bdbbe3dc059ac7c.tar.gz |
Nit fixes for boot_mode being overwritten
This is follow-up patch addressing the comments that were given
as part of review I9b6cf288b34707a8a1d5d99a95f2bc9f6bf380f1
Change-Id: Ifeb1581a6391c00f55af0068c99e141b80948cfa
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 |