ironic.common.kernel_parameters module

class ironic.common.kernel_parameters.KernelCommandLine(parameters, init_args)[source]

Bases: object

Represents 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
classmethod parse(command_line)[source]
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

bare_value(items)[source]
init_arguments(items)[source]
init_suffix(items)[source]
kernel_command_line(items)[source]
key(items)[source]
key_value_pair(items)[source]
parameter(items)[source]
parameter_list(items)[source]
quoted_value(items)[source]
value(items)[source]
value_with_spaces(items)[source]
class ironic.common.kernel_parameters.ParameterKey(key: str)[source]

Bases: object

key
class ironic.common.kernel_parameters.ParameterValue(value: str)[source]

Bases: object

value
class ironic.common.kernel_parameters.ParsedKernelCommandLine(parameters, init_args)[source]

Bases: KernelCommandLine

Represents 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().

This helps distinguish between kernel command lines that have been validated by parsing and those that have not.

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.