Skip to content
Snippets Groups Projects
Commit 2ca78df8 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Remove deprecated configuration, remove unused test files, update documentation

parent de652769
Branches
Tags
2 merge requests!71Publish LSO version 1.0,!69Feature/remove old endpoints
...@@ -25,7 +25,7 @@ An example Docker compose file is presented below: ...@@ -25,7 +25,7 @@ An example Docker compose file is presented below:
- "~/.ssh/id_ed25519:/root/.ssh/id_rsa:ro" - "~/.ssh/id_ed25519:/root/.ssh/id_rsa:ro"
restart: unless-stopped restart: unless-stopped
This will expose the API on port 8080. The container requires some additional files to be mounted: This will expose the API on port 8080. The container requires some more files to be mounted:
* A ``config.json`` that references to the location where the Ansible playbooks are stored **inside the container**. * A ``config.json`` that references to the location where the Ansible playbooks are stored **inside the container**.
* An Ansible inventory for all host and group variables that are used in the playbooks * An Ansible inventory for all host and group variables that are used in the playbooks
...@@ -34,7 +34,7 @@ This will expose the API on port 8080. The container requires some additional fi ...@@ -34,7 +34,7 @@ This will expose the API on port 8080. The container requires some additional fi
Install the module Install the module
------------------ ------------------
Alternatively, below are a set of instructions for installing and running LSO directly on a machine. As an alternative, below are a set of instructions for installing and running LSO directly on a machine.
*One of these should be what you're looking for:* *One of these should be what you're looking for:*
......
[LSO|lso] [LSO|lso]
[Ss]ubpackages [Ss]ubpackages
Vereniging Vereniging
against
"""A module for loading configuration data, including a config schema that data is validated against. """A module for loading configuration data, including a config schema that data is validated against.
Data is loaded from a file, the location of which may be specified when using :func:`load_from_file`. Data is loaded from a file, the location of which may be specified when using :func:`load_from_file`.
Config file location can also be loaded from environment variable `SETTINGS_FILENAME`, which is default behaviour in Config file location can also be loaded from environment variable ``$SETTINGS_FILENAME``, which is default behaviour in
:func:`load`. :func:`load`.
""" """
...@@ -17,7 +17,6 @@ CONFIG_SCHEMA = { ...@@ -17,7 +17,6 @@ CONFIG_SCHEMA = {
"type": "object", "type": "object",
"properties": { "properties": {
"ansible_playbooks_root_dir": {"type": "string"}, "ansible_playbooks_root_dir": {"type": "string"},
"filtered_ansible_keys": {"type": "array", "items": {"type": "string"}},
}, },
"required": ["ansible_playbooks_root_dir"], "required": ["ansible_playbooks_root_dir"],
"additionalProperties": False, "additionalProperties": False,
...@@ -28,14 +27,10 @@ DEFAULT_REQUEST_TIMEOUT = 10 ...@@ -28,14 +27,10 @@ DEFAULT_REQUEST_TIMEOUT = 10
class Config(BaseModel): class Config(BaseModel):
"""Simple Config class. """Simple Config class.
Contains the root directory at which Ansible playbooks can be found, and a list of keys that should be filtered Contains the root directory at which Ansible playbooks are present.
from playbook execution output.
""" """
ansible_playbooks_root_dir: str ansible_playbooks_root_dir: str
#: .. deprecated:: 0.21
#: Not used anymore, does not have to be present in config.
filtered_ansible_keys: list[str] | None = None
def load_from_file(file: Path) -> Config: def load_from_file(file: Path) -> Config:
...@@ -54,7 +49,7 @@ def load_from_file(file: Path) -> Config: ...@@ -54,7 +49,7 @@ def load_from_file(file: Path) -> Config:
def load() -> Config: def load() -> Config:
"""Load a config file, located at the path specified in the environment variable $SETTINGS_FILENAME. """Load a config file, located at the path specified in the environment variable ``$SETTINGS_FILENAME``.
Loading and validating the file is performed by :func:`load_from_file`. Loading and validating the file is performed by :func:`load_from_file`.
......
...@@ -33,11 +33,6 @@ def configuration_data() -> dict[str, str]: ...@@ -33,11 +33,6 @@ def configuration_data() -> dict[str, str]:
with tempfile.TemporaryDirectory() as tempdir: with tempfile.TemporaryDirectory() as tempdir:
# Create required YAML files for the unit tests # Create required YAML files for the unit tests
(Path(tempdir) / "placeholder.yaml").touch() (Path(tempdir) / "placeholder.yaml").touch()
# TODO: remove once playbook-specific endpoints are deleted
(Path(tempdir) / "base_config.yaml").touch()
(Path(tempdir) / "iptrunks.yaml").touch()
(Path(tempdir) / "iptrunks_checks.yaml").touch()
(Path(tempdir) / "iptrunks_migration.yaml").touch()
yield {"ansible_playbooks_root_dir": tempdir} yield {"ansible_playbooks_root_dir": tempdir}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment