cevoaustralia / aws-google-auth

Provides AWS STS credentials based on Google Apps SAML SSO auth (what a jumble!)
MIT License
538 stars 180 forks source link

Fixes problem with printing ExceptionGoogleException message #80

Closed kaspernissen closed 6 years ago

kaspernissen commented 6 years ago

Print of the message contained in the google.ExpectedGoogleException was looking for a variable named message which did not exist, which resulted in throwing an additional exception.

Google Password:
Traceback (most recent call last):
  File "/build/aws_google_auth/__init__.py", line 63, in cli
    process_auth(args, config)
  File "/build/aws_google_auth/__init__.py", line 184, in process_auth
    google_client.do_login()
  File "/build/aws_google_auth/google.py", line 161, in do_login
    raise ExpectedGoogleException('Invalid username or password')
aws_google_auth.google.ExpectedGoogleException: Invalid username or password

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/aws-google-auth", line 9, in <module>
    load_entry_point('aws-google-auth', 'console_scripts', 'aws-google-auth')()
  File "/build/aws_google_auth/__init__.py", line 224, in main
    cli(cli_args)
  File "/build/aws_google_auth/__init__.py", line 65, in cli
    print(ex.message)
AttributeError: 'ExpectedGoogleException' object has no attribute 'message'

with the fix in this PR:

Google Password:
Invalid username or password
stevemac007 commented 6 years ago

Finally some time to review this work again - thanks for the contribution.