Skip to content

Commit

Permalink
os: add env var string to list
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Dec 25, 2023
1 parent 382df24 commit b3a6e84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion automon/helpers/osWrapper/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .environ import environ
from .environ import *
6 changes: 6 additions & 0 deletions automon/helpers/osWrapper/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ def environ(env_var: str, default: any = None) -> bool or str or None:
return False
return f'{env}'.strip()
return default


def environ_list(env_var: str, delimiter: str = ',') -> list:
env = env_var.split(delimiter)
env = [str(x).strip() for x in env]
return env

0 comments on commit b3a6e84

Please sign in to comment.