infrahub_sdk.ctl.config
Config Class.
Classes
Settings
Main Settings Class for the project.
Methods:
cleanup_server_address
cleanup_server_address(cls, v: str) -> str
ConfiguredSettings
Methods:
active
active(self) -> Settings
load
load(self, config_file: str | Path = 'infrahubctl.toml', config_data: dict | None = None) -> None
Load configuration.
Configuration is loaded from a config file in toml format that contains the settings, or from a dictionary of those settings passed in as "config_data"
load_and_exit
load_and_exit(self, config_file: str | Path = 'infrahubctl.toml', config_data: dict | None = None) -> None
Calls load, but wraps it in a try except block.
This is done to handle a ValidationErorr which is raised when settings are specified but invalid. In such cases, a message is printed to the screen indicating the settings which don't pass validation.
Args:
config_file_name: [description]. Defaults to "pyprojectctl.toml".config_data: [description]. Defaults to None.