dhcpkit.common.server.config_elements module

The basic configuration objects

class dhcpkit.common.server.config_elements.ConfigElementFactory(section: ZConfig.matcher.SectionValue)[source]

Bases: dhcpkit.common.server.config_elements.ConfigSection

Base class for factories to create elements from configuration

create(*args, **kwargs) → object[source]

Override this method to create the element.

Returns:The element
class dhcpkit.common.server.config_elements.ConfigSection(section: ZConfig.matcher.SectionValue)[source]

Bases: object

Basic configuration section

clean_config_section()[source]

Clean up the config, calculating defaults etc.

name = None

The parsed value of the section name

name_datatype = None

The datatype of the name of this section. Sections with datatype None cannot have a name

section = None

The SectionValue we received as input from the parser

to_str(indent: int = 0) → str[source]

Return a readable string representation of this element. Because it is not in the real configuration file format we don’t attempt to make it look like one. We intentionally make it look different.

Parameters:indent – How much indentation at the start of this element
Returns:The formatted representation
validate_config_section()[source]

Validate if the information in the config section is acceptable