From 2ca78df8da99ea1ffdb67433d6cb1a62702b3edf Mon Sep 17 00:00:00 2001 From: Karel van Klink <karel.vanklink@geant.org> Date: Thu, 28 Dec 2023 17:36:38 +0100 Subject: [PATCH] Remove deprecated configuration, remove unused test files, update documentation --- docs/source/quickstart.rst | 4 ++-- docs/vale/styles/Vocab/geant-jargon/accept.txt | 1 + lso/config.py | 11 +++-------- test/conftest.py | 5 ----- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index ed6fe5d..3c88e48 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -25,7 +25,7 @@ An example Docker compose file is presented below: - "~/.ssh/id_ed25519:/root/.ssh/id_rsa:ro" 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**. * 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 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:* diff --git a/docs/vale/styles/Vocab/geant-jargon/accept.txt b/docs/vale/styles/Vocab/geant-jargon/accept.txt index 41520f5..db8478e 100644 --- a/docs/vale/styles/Vocab/geant-jargon/accept.txt +++ b/docs/vale/styles/Vocab/geant-jargon/accept.txt @@ -1,3 +1,4 @@ [LSO|lso] [Ss]ubpackages Vereniging +against diff --git a/lso/config.py b/lso/config.py index 5db9a56..a2eec06 100644 --- a/lso/config.py +++ b/lso/config.py @@ -1,7 +1,7 @@ """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`. -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`. """ @@ -17,7 +17,6 @@ CONFIG_SCHEMA = { "type": "object", "properties": { "ansible_playbooks_root_dir": {"type": "string"}, - "filtered_ansible_keys": {"type": "array", "items": {"type": "string"}}, }, "required": ["ansible_playbooks_root_dir"], "additionalProperties": False, @@ -28,14 +27,10 @@ DEFAULT_REQUEST_TIMEOUT = 10 class Config(BaseModel): """Simple Config class. - Contains the root directory at which Ansible playbooks can be found, and a list of keys that should be filtered - from playbook execution output. + Contains the root directory at which Ansible playbooks are present. """ 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: @@ -54,7 +49,7 @@ def load_from_file(file: Path) -> 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`. diff --git a/test/conftest.py b/test/conftest.py index 8bc6a73..09c0b82 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -33,11 +33,6 @@ def configuration_data() -> dict[str, str]: with tempfile.TemporaryDirectory() as tempdir: # Create required YAML files for the unit tests (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} -- GitLab