#NEWLINE# def get_boot_mode_for_deploy( node ) : #NEWLINE# #INDENT# "Returns the boot mode that would be used for deploy.\n\n    This method returns boot mode to be used for deploy.\n    It returns 'uefi' if 'secure_boot' is set to 'true' or returns 'bios' if\n    'trusted_boot' is set to 'true' in 'instance_info/capabilities' of node.\n    Otherwise it returns value of 'boot_mode' in 'properties/capabilities'\n    of node if set. If that is not set, it returns boot mode in\n    'instance_info/deploy_boot_mode' for the node.\n    It would return None if boot mode is present neither in 'capabilities' of\n    node 'properties' nor in node's 'instance_info' (which could also be None).\n\n    :param node: an ironic node object.\n    :returns: 'bios', 'uefi' or None\n    " #NEWLINE# if is_secure_boot_requested ( node ) : #NEWLINE# #INDENT# LOG . debug ( 'Deploy boot mode is uefi for %s.' , node . uuid ) #NEWLINE# return 'uefi' #NEWLINE# #UNINDENT# if is_trusted_boot_requested ( node ) : #NEWLINE# #INDENT# LOG . debug ( 'Deploy boot mode is bios for %s.' , node . uuid ) #NEWLINE# return 'bios' #NEWLINE# #UNINDENT# boot_mode = driver_utils . get_node_capability ( node , 'boot_mode' ) #NEWLINE# if ( boot_mode is None ) : #NEWLINE# #INDENT# instance_info = node . instance_info #NEWLINE# boot_mode = instance_info . get ( 'deploy_boot_mode' ) #NEWLINE# #UNINDENT# LOG . debug ( 'Deploy boot mode is %(boot_mode)s for %(node)s.' , { #NEWLINE# #INDENT# 'boot_mode' : boot_mode , #NEWLINE# 'node' : node . uuid , #NEWLINE# #UNINDENT# } ) #NEWLINE# return ( boot_mode . lower ( ) if boot_mode else boot_mode )