Skip to content

Commit

Permalink
KSM-567 Added KSM_CLI_TOKEN environment variable (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
idimov-keeper authored Oct 28, 2024
1 parent 68ed16a commit b7f7b77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,11 @@ def profile_command():
def profile_init_command(ctx, token, hostname, ini_file, profile_name, token_arg):
"""Initialize a profile"""

# Command line --token option overrides all other options
if token is None and len(token_arg) > 0:
token = token_arg[0]
if token is None:
token = os.environ.get("KSM_CLI_TOKEN", None)
if token is None:
raise KsmCliException("A one time access token is required either as a command parameter or an argument.")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(self, cli, ini_file=None, config=None):
Profile.init(
token=os.environ.get("KSM_TOKEN"),
server=os.environ.get("KSM_HOSTNAME", "US"),
ini_file=ini_file,
launched_from_app=self._config.launched_from_app
)
else:
Expand Down

0 comments on commit b7f7b77

Please sign in to comment.