Skip to content

Commit d74f7d1

Browse files
authored
Merge pull request #10 from DavidStirling/print-host
Report host for invalid tokens
2 parents 6e6fb06 + 1ad98c0 commit d74f7d1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

omero_user_token/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ def getter():
9595
try:
9696
token = get_token()
9797
client = login(token)
98+
host = client.getProperty("omero.host")
9899
try:
99100
client.getSession()
100101
except Exception:
101-
sys.exit('ERROR: Token is invalid!')
102+
sys.exit(f'ERROR: Token for {host} is invalid!')
102103
finally:
103104
client.closeSession()
104105
return token

omero_user_token/cli/omero_user_token.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def cli():
4444
def _set(server, port, user, time_to_idle):
4545
password = getpass.getpass("Password: ")
4646
token = setter(server, port, user, password, time_to_idle)
47-
print('Successfuly set token: %s' % token)
47+
print('Successfully set token: %s' % token)
4848

4949

5050
@click.command()

0 commit comments

Comments
 (0)