certwrangler.utils module#
- class certwrangler.utils.LogLevels(*values)[source]#
Bases:
IntEnum
An Enum representing the supported log levels.
- debug#
- info#
- warning#
- error#
- critical#
- class certwrangler.utils.CertwranglerState(config_path: Path = PosixPath('/github/home/.config/certwrangler.yaml'), config: Config | None = None)[source]#
Bases:
object
The main state of the application. This class is responsible for loading the config from disk, setting up logging, and storing config passed in from CLI options.
- config_path: Path#
A
pathlib.Path
object referencing the location of the config file. Defaults to ‘${XDG_CONFIG_HOME}/certwrangler.yaml’ or ‘~/.config/certwrangler.yaml’ if ‘${XDG_CONFIG_HOME}’ is not set.
- daemon: Daemon#
The instance of
certwrangler.daemon.Daemon
.
- config: Config | None#
The loaded instance of
certwrangler.models.Config
, populated byload_config()
.
- resolver: Resolver#
The instance of
dns.resolver.Resolver
used for all DNS operations.
- load_config(initialize: bool = False) None [source]#
Loads the config from config_path and optionally initializes it. This also cascades the change to the metrics system to reconcile the entities in the metrics registries.
- Parameters:
initialize – If
True
,certwrangler.models.Config.initialize()
will be called onCertwranglerState.config
after loading.- Raises:
ConfigError – Raised on any issues with loading, parsing, or initializing the config.