Skip to content

Commit

Permalink
Review changes (squash this commit please).
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Feb 12, 2016
1 parent a1de232 commit 7cca60f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions gcloud/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,9 @@ def _get_pem_key(credentials):
'not a valid service account credentials type'))

if crypto is None:
raise EnvironmentError('pyOpenSSL must be installed to load a '
'private key')
else:
return crypto.load_privatekey(crypto.FILETYPE_PEM, pem_text)
raise EnvironmentError(
'pyOpenSSL must be installed to load a private key')
return crypto.load_privatekey(crypto.FILETYPE_PEM, pem_text)


def _get_signature_bytes(credentials, string_to_sign):
Expand Down Expand Up @@ -221,8 +220,7 @@ def _get_signature_bytes(credentials, string_to_sign):
if crypto is None:
raise EnvironmentError('pyOpenSSL must be installed to sign '
'content using a private key')
else:
return crypto.sign(pkey, string_to_sign, 'SHA256')
return crypto.sign(pkey, string_to_sign, 'SHA256')


def _get_service_account_name(credentials):
Expand Down

0 comments on commit 7cca60f

Please sign in to comment.