Skip to content

Commit

Permalink
Corrected Google Cloud VM error: (#125)
Browse files Browse the repository at this point in the history
On Google Cloud VMs, the user's account email is stored in a different
attribute of the Session's Credentials object (service_account_email
rather than id_token). The existence of the attributes are also mutually
exclusive. This caused an AttributeError when accessing a non-existent
attribute, and failure to populate __USER_ID, which broke several
functions. Updated api.py to handle the different attribute locations.
  • Loading branch information
dheiman authored Jun 12, 2019
1 parent b901964 commit ec3aab5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Change Log for FISSFC: the (Fi)recloud (S)ervice (S)elector
=======================================================================
Terms used below: HL = high level interface, LL = low level interface

v0.16.24 - Hotfix: corrected error in api.py due to difference in user ID
location when run from a Google Cloud VM; setup.py updated to
explicitly designate long_description_content_type as text/plain.

v0.16.23 - LL: get_entities_tsv updated with ability to specify ordered
attributes and data model, upload_entities and upload_entities_tsv
updated to enable use of flexible data model API; HL: added back
Expand Down
2 changes: 1 addition & 1 deletion firecloud/__about__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Package version
__version__ = "0.16.23"
__version__ = "0.16.24"
2 changes: 2 additions & 0 deletions firecloud/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def _set_session():
health()
__USER_ID = id_token.verify_oauth2_token(__SESSION.credentials.id_token,
Request(session=__SESSION))['email']
except AttributeError:
__USER_ID = __SESSION.credentials.service_account_email
except (DefaultCredentialsError, RefreshError) as gae:
if os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine/'):
raise
Expand Down

0 comments on commit ec3aab5

Please sign in to comment.