Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
use simple zign.api.get_token() function
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Dec 7, 2015
1 parent bc8dd74 commit 3ed711c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions piu/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,8 @@ def list_access_requests(obj, user, odd_host, status, limit, offset, output):
elif odd_host == 'MY-ODD-HOST':
odd_host = config.get('odd_host')

token = zign.api.get_existing_token('piu')
if not token:
raise click.UsageError('No valid OAuth token named "piu" found.')
access_token = zign.api.get_token('piu', ['piu'])

access_token = token.get('access_token')
params = {'username': user, 'hostname': odd_host, 'status': status, 'limit': limit, 'offset': offset}
r = requests.get(config.get('even_url').rstrip('/') + '/access-requests',
params=params,
Expand Down

0 comments on commit 3ed711c

Please sign in to comment.