Skip to content

Commit

Permalink
Address reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
synkd committed May 31, 2024
1 parent 832b5bc commit 45588d7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion manifester/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Expand Down
2 changes: 1 addition & 1 deletion manifester/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
6 changes: 3 additions & 3 deletions manifester/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
8 changes: 4 additions & 4 deletions scripts/vault_login.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 45588d7

Please sign in to comment.