Skip to content

Commit

Permalink
#42 do not warn on "zign token"
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Jan 11, 2017
1 parent b82c66c commit 209c2c8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions zign/cli_zign.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import stups_cli.config

from .api import get_named_token, ServerError
from .api import get_token, ServerError
from .cli import output_option, print_version
from zign import cli

Expand Down Expand Up @@ -39,6 +39,7 @@ def delete_token(ctx, name):

@cli_zign.command()
@click.argument('scope', nargs=-1)
# all these options are not used anymore, just for compatibility..
@click.option('--url', help='URL to generate access token', metavar='URI')
@click.option('--realm', help='Use custom OAuth2 realm', metavar='NAME')
@click.option('-n', '--name', help='Custom token name (will be stored)', metavar='TOKEN_NAME')
Expand All @@ -50,14 +51,7 @@ def delete_token(ctx, name):
def token(obj, scope, url, realm, name, user, password, insecure, refresh):
'''Create a new token or use an existing one'''

user = user or obj.get('user') or os.getenv('USER')

try:
token = get_named_token(scope, realm, name, user, password, url, insecure, refresh, prompt=True)
except ServerError as e:
raise click.UsageError(e)
access_token = token.get('access_token')

access_token = get_token(name, scope)
print(access_token)


Expand Down

0 comments on commit 209c2c8

Please sign in to comment.