lso.config

Module for loading and managing configuration settings for the LSO app.

Uses pydantic’s BaseSettings to load settings from environment variables.

class lso.config.Config(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_implicit_flags=None, _secrets_dir=None, *, TESTING=False, ANSIBLE_PLAYBOOKS_ROOT_DIR='/path/to/ansible/playbooks', EXECUTOR=ExecutorType.THREADPOOL, MAX_THREAD_POOL_WORKERS=8, REQUEST_TIMEOUT_SEC=10, CELERY_BROKER_URL='redis://localhost:6379/0', CELERY_RESULT_BACKEND='redis://localhost:6379/0', CELERY_TIMEZONE='Europe/Amsterdam', CELERY_ENABLE_UTC=True, CELERY_RESULT_EXPIRES=3600, WORKER_QUEUE_NAME=None)

Bases: BaseSettings

The set of parameters required for running LSO.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_computed_fields = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_hide_none_type': False, 'cli_implicit_flags': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_settings_source': None, 'cli_use_class_docs_for_groups': False, 'env_file': None, 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': '', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_file': None, 'yaml_file_encoding': None}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields = {'ANSIBLE_PLAYBOOKS_ROOT_DIR': FieldInfo(annotation=str, required=False, default='/path/to/ansible/playbooks'), 'CELERY_BROKER_URL': FieldInfo(annotation=str, required=False, default='redis://localhost:6379/0'), 'CELERY_ENABLE_UTC': FieldInfo(annotation=bool, required=False, default=True), 'CELERY_RESULT_BACKEND': FieldInfo(annotation=str, required=False, default='redis://localhost:6379/0'), 'CELERY_RESULT_EXPIRES': FieldInfo(annotation=int, required=False, default=3600), 'CELERY_TIMEZONE': FieldInfo(annotation=str, required=False, default='Europe/Amsterdam'), 'EXECUTOR': FieldInfo(annotation=ExecutorType, required=False, default=<ExecutorType.THREADPOOL: 'threadpool'>), 'MAX_THREAD_POOL_WORKERS': FieldInfo(annotation=int, required=False, default=8), 'REQUEST_TIMEOUT_SEC': FieldInfo(annotation=int, required=False, default=10), 'TESTING': FieldInfo(annotation=bool, required=False, default=False), 'WORKER_QUEUE_NAME': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

class lso.config.ExecutorType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Enum representing the types of executors available for task execution.