diff --git a/manifester/commands.py b/manifester/commands.py index 0e60ff0..cb3d6c2 100644 --- a/manifester/commands.py +++ b/manifester/commands.py @@ -61,7 +61,7 @@ def delete(allocations, all_, remove_manifest_file): ) if remove_manifest_file: manifester_directory = ( - Path(os.environ["MANIFESTER_DIRECTORY"]) + Path(os.environ["MANIFESTER_DIRECTORY"]).resolve() if "MANIFESTER_DIRECTORY" in os.environ else Path() ) diff --git a/manifester/helpers.py b/manifester/helpers.py index 775ab83..1dfccd1 100644 --- a/manifester/helpers.py +++ b/manifester/helpers.py @@ -347,7 +347,7 @@ def login(self, **kwargs): def logout(self): """Revoke Vault auth token and remove it from .env file.""" - # Teardown - Setting dymmy token in env file + # Teardown - Setting dummy token in env file _envdata = re.sub( ".*VAULT_TOKEN_FOR_DYNACONF=.*", "# VAULT_TOKEN_FOR_DYNACONF=myroot", self.envdata ) diff --git a/manifester/settings.py b/manifester/settings.py index b56c583..2e9182f 100644 --- a/manifester/settings.py +++ b/manifester/settings.py @@ -2,7 +2,7 @@ import os from pathlib import Path -from dynaconf import LazySettings, Validator +from dynaconf import Dynaconf, Validator settings_file = "manifester_settings.yaml" MANIFESTER_DIRECTORY = Path() @@ -18,10 +18,10 @@ Validator("simple_content_access", default="enabled"), Validator("username_prefix", len_min=3), ] -settings = LazySettings( +settings = Dynaconf( settings_file=str(settings_path.absolute()), ENVVAR_PREFIX_FOR_DYNACONF="MANIFESTER", load_dotenv=True, validators=validators, ) -settings.validators.validate() +# settings.validators.validate() diff --git a/scripts/vault_login.py b/scripts/vault_login.py index 709ab2f..e95f506 100755 --- a/scripts/vault_login.py +++ b/scripts/vault_login.py @@ -1,14 +1,14 @@ #!/usr/bin/env python -# This Enables and Disables individuals OIDC token to access secrets from vault +"""Enables and Disables an OIDC token to access secrets from HashiCorp Vault.""" import sys from manifester.helpers import Vault -if __name__ == '__main__': +if __name__ == "__main__": with Vault() as vclient: - if sys.argv[-1] == '--login': + if sys.argv[-1] == "--login": vclient.login() - elif sys.argv[-1] == '--status': + elif sys.argv[-1] == "--status": vclient.status() else: vclient.logout()