Skip to content

Commit 7cca60f

Browse files
committed
Review changes (squash this commit please).
1 parent a1de232 commit 7cca60f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

gcloud/credentials.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,9 @@ def _get_pem_key(credentials):
188188
'not a valid service account credentials type'))
189189

190190
if crypto is None:
191-
raise EnvironmentError('pyOpenSSL must be installed to load a '
192-
'private key')
193-
else:
194-
return crypto.load_privatekey(crypto.FILETYPE_PEM, pem_text)
191+
raise EnvironmentError(
192+
'pyOpenSSL must be installed to load a private key')
193+
return crypto.load_privatekey(crypto.FILETYPE_PEM, pem_text)
195194

196195

197196
def _get_signature_bytes(credentials, string_to_sign):
@@ -221,8 +220,7 @@ def _get_signature_bytes(credentials, string_to_sign):
221220
if crypto is None:
222221
raise EnvironmentError('pyOpenSSL must be installed to sign '
223222
'content using a private key')
224-
else:
225-
return crypto.sign(pkey, string_to_sign, 'SHA256')
223+
return crypto.sign(pkey, string_to_sign, 'SHA256')
226224

227225

228226
def _get_service_account_name(credentials):

0 commit comments

Comments
 (0)