ironic.common.kernel_parameters module¶
- class ironic.common.kernel_parameters.KernelCommandLine(parameters, init_args)[source]¶
Bases:
objectRepresents a kernel command line.
NOTE: An instantiated object of this type does not guarantee that it has passed parsing via KernelParameterParser. ParsedKernelCommandLine is reserved for this distinction.
- init_args¶
- parameters¶
- class ironic.common.kernel_parameters.KernelParameter(key: ironic.common.kernel_parameters.ParameterKey, value: ironic.common.kernel_parameters.ParameterValue)[source]¶
Bases:
object- key¶
- value¶
- class ironic.common.kernel_parameters.KernelParameterTransformer(visit_tokens=True)[source]¶
Bases:
Transformer
- class ironic.common.kernel_parameters.ParameterSet(parameters: dict[str, ironic.common.kernel_parameters.KernelParameter])[source]¶
Bases:
object- parameters¶
- class ironic.common.kernel_parameters.ParsedKernelCommandLine(parameters, init_args)[source]¶
Bases:
KernelCommandLineRepresents a parsed kernel command line.
NOTE: This object should only be instantiated via passing a kernel command line string through KernelParameterParser.parse() and then the resultant parse tree through KernelParameterTransformer.transform(). Constructing this directly is almost certainly a mistake.
This class helps distinguish between kernel command lines that have been validated by parsing and those that have not.
- class ironic.common.kernel_parameters.UnsafeKernelCommandLine(parameters, init_args, unstructured_params)[source]¶
Bases:
KernelCommandLineRepresents a kernel command line that has not been parsed.
Includes the field ‘unstructured_params’, which are treated as opaque strings which haven’t been parsed. To convert this to a ParsedKernelCommandLine, use KernelCommandLine.parse(str(unsafe_cmd_line)).
- unstructured_params¶
- class ironic.common.kernel_parameters.UnstructuredParameters(value: str)[source]¶
Bases:
object- value¶
- ironic.common.kernel_parameters.sanitize_kernel_command_line(command_line)[source]¶
Applies filtering to a command line to sanitize it.
NOTE: This does not guarantee a correct or safe kernel command line, for stronger guarantees of correctness and safety use KernelCommandLine.parse().
- Parameters:
command_line – A string containing a kernel command line or individual parameters.
- Returns:
A filtered string which should be safer for use.