Skip to content

Commit

Permalink
remove unnecessary gce serviceaccounts assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
zshihang committed Feb 15, 2020
1 parent 9659f28 commit 06a7524
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions apitools/base/py/credentials_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,6 @@ def _ScopesFromMetadataServer(self, scopes):
if not util.DetectGce():
raise exceptions.ResourceUnavailableError(
'GCE credentials requested outside a GCE instance')
if not self.GetServiceAccount(self.__service_account_name):
raise exceptions.ResourceUnavailableError(
'GCE credentials requested but service account '
'%s does not exist.' % self.__service_account_name)
if scopes:
scope_ls = util.NormalizeScopes(scopes)
instance_scopes = self.GetInstanceScopes()
Expand Down
2 changes: 1 addition & 1 deletion apitools/base/py/credentials_lib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _GetServiceCreds(self, service_account_name=None, scopes=None):
credentials = self._RunGceAssertionCredentials(
service_account_name=service_account_name,
scopes=scopes)
self.assertEqual(3, opener_mock.call_count)
self.assertEqual(2, opener_mock.call_count)
return credentials

def testGceServiceAccounts(self):
Expand Down

0 comments on commit 06a7524

Please sign in to comment.