#NEWLINE# def create_pxe_config( task , pxe_options , template = None ) : #NEWLINE# #INDENT# "Generate PXE configuration file and MAC address links for it.\n\n    This method will generate the PXE configuration file for the task's\n    node under a directory named with the UUID of that node. For each\n    MAC address or DHCP IP address (port) of that node, a symlink for\n    the configuration file will be created under the PXE configuration\n    directory, so regardless of which port boots first they'll get the\n    same PXE configuration.\n    If elilo is the bootloader in use, then its configuration file will\n    be created based on hex form of DHCP IP address.\n    If grub2 bootloader is in use, then its configuration will be created\n    based on DHCP IP address in the form nn.nn.nn.nn.\n\n    :param task: A TaskManager instance.\n    :param pxe_options: A dictionary with the PXE configuration\n        parameters.\n    :param template: The PXE configuration template. If no template is\n        given the CONF.pxe.pxe_config_template will be used.\n\n    " #NEWLINE# LOG . debug ( 'Building PXE config for node %s' , task . node . uuid ) #NEWLINE# if ( template is None ) : #NEWLINE# #INDENT# template = CONF . pxe . pxe_config_template #NEWLINE# #UNINDENT# _ensure_config_dirs_exist ( task . node . uuid ) #NEWLINE# pxe_config_file_path = get_pxe_config_file_path ( task . node . uuid ) #NEWLINE# is_uefi_boot_mode = ( deploy_utils . get_boot_mode_for_deploy ( task . node ) == 'uefi' ) #NEWLINE# hex_form = True #NEWLINE# if ( is_uefi_boot_mode and utils . is_regex_string_in_file ( template , '^menuentry' ) ) : #NEWLINE# #INDENT# hex_form = False #NEWLINE# pxe_config_root_tag = '(( ROOT ))' #NEWLINE# pxe_config_disk_ident = '(( DISK_IDENTIFIER ))' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pxe_config_root_tag = '{{ ROOT }}' #NEWLINE# pxe_config_disk_ident = '{{ DISK_IDENTIFIER }}' #NEWLINE# #UNINDENT# pxe_config = _build_pxe_config ( pxe_options , template , pxe_config_root_tag , pxe_config_disk_ident ) #NEWLINE# utils . write_to_file ( pxe_config_file_path , pxe_config ) #NEWLINE# if ( is_uefi_boot_mode and ( not CONF . pxe . ipxe_enabled ) ) : #NEWLINE# #INDENT# _link_ip_address_pxe_configs ( task , hex_form ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# _link_mac_pxe_configs ( task )