Skip to content
Snippets Groups Projects
Commit 46228a14 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Using the config user and password in CLI when no user is given via

args.

Changelog: Fixed
parent f7715b89
No related branches found
No related tags found
1 merge request!2089Changes required for the new UI
Pipeline #223963 passed
......@@ -62,16 +62,22 @@ def client(
def _create_auth(ctx):
print(f'Used nomad is {config.client.url}')
print(f'Used user is {ctx.obj.user}')
print(
f'Used user from CLI args is {ctx.obj.user}, using config.client.user {config.client.user}'
)
from nomad.client import Auth
if ctx.obj.user is None:
return None
return Auth(
user=ctx.obj.user, password=ctx.obj.password, from_api=ctx.obj.token_via_api
)
return Auth(
user=config.client.user,
password=config.client.password,
from_api=ctx.obj.token_via_api,
)
else:
return Auth(
user=ctx.obj.user, password=ctx.obj.password, from_api=ctx.obj.token_via_api
)
@client.command(help='Runs a few example operations as a test.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment