Skip to content

Commit

Permalink
Fix logic bug re: secrets basedir validation
Browse files Browse the repository at this point in the history
  • Loading branch information
davedittrich committed Apr 27, 2023
1 parent d847715 commit 1b9e7d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions psec/cli/init.py
Expand Up @@ -46,10 +46,8 @@ class Init(Command):
logger = logging.getLogger(__name__)

def get_parser(self, prog_name):
try:
basedir = self.app.secrets_basedir
except AttributeError:
# For cliff
basedir = getattr(self.app, 'secrets_basedir', None)
if basedir is None:
basedir = get_default_secrets_basedir()
parser = super().get_parser(prog_name)
parser.add_argument(
Expand Down
4 changes: 3 additions & 1 deletion psec/utils.py
Expand Up @@ -204,7 +204,9 @@ def secrets_basedir_create(
):
"""Create secrets root directory"""
if basedir is None:
raise RuntimeError("[-] a base directory is required")
raise RuntimeError(
"[-] no base directory path specified"
)
secrets_basedir = Path(basedir)
secrets_basedir.mkdir(
parents=True,
Expand Down

0 comments on commit 1b9e7d6

Please sign in to comment.