Module Import alias ImportFrom alias identifier Import alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str FunctionDef arguments args defaults body Expr Str If AttributeLoad AttributeLoad NameLoad attr attr body Return AttributeLoad AttributeLoad NameLoad attr attr orelse Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr Dict Str Str Str NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Assign NameStore Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr For NameStore Call AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad Call NameLoad NameLoad If AttributeLoad AttributeLoad NameLoad attr attr body Expr Call NameLoad Call NameLoad NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Raise Call AttributeLoad NameLoad attr BinOpMod Call NameLoad Str AttributeLoad AttributeLoad NameLoad attr attr For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str NameLoad attr If UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore BinOpAdd Str NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad Str attr Call NameLoad NameLoad NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Dict For NameStore TupleLoad Str Str body Assign SubscriptStore NameLoad Index NameLoad TupleLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore CompareEq Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Assign NameStore NameLoad If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr NameLoad Str body Assign NameStore NameLoad Assign NameStore Str Assign NameStore Str orelse Assign NameStore Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If BoolOpAnd NameLoad UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Expr Call NameLoad NameLoad NameLoad orelse Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore CompareEq Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str If BoolOpAnd NameLoad UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return For NameStore NameLoad body TryExcept body Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Continue Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse For NameStore Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad If AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad If CompareEq Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Str attr ListLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Dict Str Str Str NameLoad Expr Call AttributeLoad NameLoad attr Dict Str Str Str NameLoad orelse Expr Call AttributeLoad NameLoad attr Dict Str Str Str NameLoad Expr Call AttributeLoad NameLoad attr Dict Str Str Str NameLoad orelse Expr Call AttributeLoad NameLoad attr Dict Str Str Str NameLoad Expr Call AttributeLoad NameLoad attr Dict Str Str Str AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Dict Str Str Str AttributeLoad AttributeLoad NameLoad attr attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Dict Str Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list
N/A N/A os ironic_lib utils ironic_utils N/A jinja2 oslo_config cfg oslo_log log logging oslo_utils fileutils ironic.common dhcp_factory ironic.common exception ironic.common.i18n _ ironic.common utils ironic.drivers.modules deploy_utils ironic.drivers utils driver_utils N/A CONF N/A cfg CONF N/A LOG N/A N/A logging getLogger __name__ N/A PXE_CFG_DIR_NAME pxelinux.cfg get_root_dir N/A N/A N/A N/A N/A Returns the directory where the config files and images will live. N/A N/A N/A CONF pxe ipxe_enabled N/A N/A N/A N/A CONF deploy http_root N/A N/A N/A N/A CONF pxe tftp_root N/A _ensure_config_dirs_exist N/A N/A node_uuid N/A N/A N/A Ensure that the node's and PXE configuration directories exist.

    :param node_uuid: the UUID of the node.

     N/A root_dir N/A get_root_dir N/A N/A N/A fileutils ensure_tree N/A N/A N/A os path join root_dir node_uuid N/A N/A N/A fileutils ensure_tree N/A N/A N/A os path join root_dir PXE_CFG_DIR_NAME N/A _build_pxe_config N/A N/A pxe_options template root_tag disk_ident_tag N/A N/A N/A Build the PXE boot configuration file.

    This method builds the PXE boot configuration file by rendering the
    template with the given parameters.

    :param pxe_options: A dict of values to set on the configuration file.
    :param template: The PXE configuration template.
    :param root_tag: Root tag used in the PXE config file.
    :param disk_ident_tag: Disk identifier tag used in the PXE config file.
    :returns: A formatted string with the file content.

     N/A N/A tmpl_path tmpl_file N/A N/A N/A os path split template N/A env N/A N/A jinja2 Environment loader N/A N/A jinja2 FileSystemLoader tmpl_path N/A template N/A N/A env get_template tmpl_file N/A N/A N/A template render N/A pxe_options ROOT DISK_IDENTIFIER pxe_options root_tag disk_ident_tag N/A _link_mac_pxe_configs N/A N/A task N/A N/A N/A Link each MAC address with the PXE configuration file.

    :param task: A TaskManager instance.

     create_link N/A N/A mac_path N/A N/A N/A N/A N/A ironic_utils unlink_without_raise mac_path N/A relative_source_path N/A N/A N/A os path relpath pxe_config_file_path N/A N/A N/A os path dirname mac_path N/A N/A N/A utils create_link_without_raise relative_source_path mac_path N/A N/A pxe_config_file_path N/A get_pxe_config_file_path N/A N/A task node uuid N/A mac N/A N/A driver_utils get_node_mac_addresses task N/A N/A N/A create_link N/A _get_pxe_mac_path mac N/A N/A N/A CONF pxe ipxe_enabled N/A N/A N/A create_link N/A _get_pxe_mac_path mac delimiter N/A _link_ip_address_pxe_configs N/A N/A task hex_form N/A N/A N/A Link each IP address with the PXE configuration file.

    :param task: A TaskManager instance.
    :param hex_form: Boolean value indicating if the conf file name should be
                     hexadecimal equivalent of supplied ipv4 address.
    :raises: FailedToGetIPAddressOnPort
    :raises: InvalidIPv4Address

     N/A pxe_config_file_path N/A get_pxe_config_file_path N/A N/A task node uuid N/A api N/A N/A N/A dhcp_factory DHCPFactory provider N/A ip_addrs N/A N/A api get_ip_addresses task N/A N/A ip_addrs N/A N/A N/A N/A exception FailedToGetIPAddressOnPort N/A N/A _ Failed to get IP address for any port on node %s. N/A N/A task node uuid N/A port_ip_address ip_addrs N/A N/A ip_address_path N/A _get_pxe_ip_address_path port_ip_address hex_form N/A N/A N/A ironic_utils unlink_without_raise ip_address_path N/A relative_source_path N/A N/A N/A os path relpath pxe_config_file_path N/A N/A N/A os path dirname ip_address_path N/A N/A N/A utils create_link_without_raise relative_source_path ip_address_path N/A _get_pxe_mac_path N/A N/A mac delimiter N/A None N/A N/A Convert a MAC address into a PXE config file name.

    :param mac: A MAC address string in the format xx:xx:xx:xx:xx:xx.
    :param delimiter: The MAC address delimiter. Defaults to dash ('-').
    :returns: the path to the config file.

     N/A N/A delimiter None N/A N/A delimiter - N/A mac_file_name N/A N/A N/A N/A mac replace : delimiter lower N/A N/A N/A N/A CONF pxe ipxe_enabled N/A N/A mac_file_name N/A 01- mac_file_name N/A N/A N/A N/A os path join N/A get_root_dir PXE_CFG_DIR_NAME mac_file_name N/A _get_pxe_ip_address_path N/A N/A ip_address hex_form N/A N/A N/A Convert an ipv4 address into a PXE config file name.

    :param ip_address: A valid IPv4 address string in the format 'n.n.n.n'.
    :param hex_form: Boolean value indicating if the conf file name should be
                     hexadecimal equivalent of supplied ipv4 address.
    :returns: the path to the config file.

     N/A hex_form N/A N/A ip N/A N/A ip_address split . N/A ip_address N/A N/A {0:02X}{1:02X}{2:02X}{3:02X} format N/A map int ip N/A N/A N/A N/A os path join N/A N/A CONF pxe tftp_root N/A ip_address .conf N/A get_deploy_kr_info N/A N/A node_uuid driver_info N/A N/A N/A Get href and tftp path for deploy kernel and ramdisk.

    Note: driver_info should be validated outside of this method.
     N/A root_dir N/A get_root_dir N/A image_info N/A N/A label N/A deploy_kernel deploy_ramdisk N/A N/A N/A image_info N/A label N/A N/A str N/A driver_info N/A label N/A N/A N/A os path join root_dir node_uuid label N/A image_info N/A get_pxe_config_file_path N/A N/A node_uuid N/A N/A N/A Generate the path for the node's PXE configuration file.

    :param node_uuid: the UUID of the node.
    :returns: The path to the node's PXE configuration file.

     N/A N/A N/A N/A os path join N/A get_root_dir node_uuid config N/A create_pxe_config N/A N/A task pxe_options template N/A None N/A N/A Generate PXE configuration file and MAC address links for it.

    This method will generate the PXE configuration file for the task's
    node under a directory named with the UUID of that node. For each
    MAC address or DHCP IP address (port) of that node, a symlink for
    the configuration file will be created under the PXE configuration
    directory, so regardless of which port boots first they'll get the
    same PXE configuration.
    If elilo is the bootloader in use, then its configuration file will
    be created based on hex form of DHCP IP address.
    If grub2 bootloader is in use, then its configuration will be created
    based on DHCP IP address in the form nn.nn.nn.nn.

    :param task: A TaskManager instance.
    :param pxe_options: A dictionary with the PXE configuration
        parameters.
    :param template: The PXE configuration template. If no template is
        given the CONF.pxe.pxe_config_template will be used.

     N/A N/A N/A LOG debug Building PXE config for node %s N/A N/A task node uuid N/A N/A template None N/A N/A template N/A N/A CONF pxe pxe_config_template N/A N/A _ensure_config_dirs_exist N/A N/A task node uuid N/A pxe_config_file_path N/A get_pxe_config_file_path N/A N/A task node uuid N/A is_uefi_boot_mode N/A N/A N/A deploy_utils get_boot_mode_for_deploy N/A task node uefi N/A hex_form True N/A N/A is_uefi_boot_mode N/A N/A utils is_regex_string_in_file template ^menuentry N/A N/A hex_form False N/A pxe_config_root_tag (( ROOT )) N/A pxe_config_disk_ident (( DISK_IDENTIFIER )) N/A N/A pxe_config_root_tag {{ ROOT }} N/A pxe_config_disk_ident {{ DISK_IDENTIFIER }} N/A pxe_config N/A _build_pxe_config pxe_options template pxe_config_root_tag pxe_config_disk_ident N/A N/A N/A utils write_to_file pxe_config_file_path pxe_config N/A N/A is_uefi_boot_mode N/A N/A N/A CONF pxe ipxe_enabled N/A N/A N/A _link_ip_address_pxe_configs task hex_form N/A N/A N/A _link_mac_pxe_configs task N/A clean_up_pxe_config N/A N/A task N/A N/A N/A Clean up the TFTP environment for the task's node.

    :param task: A TaskManager instance.

     N/A N/A N/A LOG debug Cleaning up PXE config for node %s N/A N/A task node uuid N/A is_uefi_boot_mode N/A N/A N/A deploy_utils get_boot_mode_for_deploy N/A task node uefi N/A N/A is_uefi_boot_mode N/A N/A N/A CONF pxe ipxe_enabled N/A N/A api N/A N/A N/A dhcp_factory DHCPFactory provider N/A ip_addresses N/A N/A api get_ip_addresses task N/A N/A ip_addresses N/A N/A N/A port_ip_address ip_addresses N/A N/A N/A N/A ip_address_path N/A _get_pxe_ip_address_path port_ip_address False N/A hex_ip_path N/A _get_pxe_ip_address_path port_ip_address True N/A N/A N/A N/A exception InvalidIPv4Address N/A N/A N/A N/A N/A ironic_utils unlink_without_raise ip_address_path N/A N/A N/A ironic_utils unlink_without_raise hex_ip_path N/A N/A mac N/A N/A driver_utils get_node_mac_addresses task N/A N/A N/A N/A ironic_utils unlink_without_raise N/A _get_pxe_mac_path mac N/A N/A N/A CONF pxe ipxe_enabled N/A N/A N/A N/A ironic_utils unlink_without_raise N/A _get_pxe_mac_path mac delimiter N/A N/A N/A utils rmtree_without_raise N/A N/A N/A os path join N/A get_root_dir N/A N/A task node uuid N/A dhcp_options_for_instance N/A N/A task N/A N/A N/A Retrieves the DHCP PXE boot options.

    :param task: A TaskManager instance.
     N/A dhcp_opts N/A N/A N/A N/A N/A deploy_utils get_boot_mode_for_deploy N/A task node uefi N/A N/A boot_file N/A N/A CONF pxe uefi_pxe_bootfile_name N/A N/A boot_file N/A N/A CONF pxe pxe_bootfile_name N/A N/A N/A CONF pxe ipxe_enabled N/A N/A script_name N/A N/A N/A os path basename N/A N/A CONF pxe ipxe_boot_script N/A ipxe_script_url N/A N/A / join N/A N/A N/A CONF deploy http_url script_name N/A dhcp_provider_name N/A N/A N/A dhcp_factory CONF dhcp dhcp_provider N/A N/A dhcp_provider_name neutron N/A N/A N/A N/A dhcp_opts append N/A opt_name opt_value tag:!ipxe,bootfile-name boot_file N/A N/A N/A dhcp_opts append N/A opt_name opt_value tag:ipxe,bootfile-name ipxe_script_url N/A N/A N/A N/A dhcp_opts append N/A opt_name opt_value !175,bootfile-name boot_file N/A N/A N/A dhcp_opts append N/A opt_name opt_value bootfile-name ipxe_script_url N/A N/A N/A N/A dhcp_opts append N/A opt_name opt_value bootfile-name boot_file N/A N/A N/A dhcp_opts append N/A opt_name opt_value server-ip-address N/A N/A CONF pxe tftp_server N/A N/A N/A dhcp_opts append N/A opt_name opt_value tftp-server N/A N/A CONF pxe tftp_server N/A opt dhcp_opts N/A N/A N/A N/A opt update N/A ip_version N/A int N/A N/A CONF pxe ip_version N/A dhcp_opts N/A