Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f68b0d

Browse files
author
Takashi Matsuo
authored
testing(iam): fix failing cleanup code (GoogleCloudPlatform#4495)
fixes GoogleCloudPlatform#4486
1 parent 0b96e4c commit 1f68b0d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

iam/api-client/service_accounts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def enable_service_account(email):
146146
service.projects().serviceAccounts().enable(
147147
name='projects/-/serviceAccounts/' + email).execute()
148148

149-
print("Disabled service account :" + email)
149+
print("Enabled service account :" + email)
150150
# [END iam_enable_service_account]
151151

152152

iam/api-client/service_accounts_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ def test_service_accounts(capsys):
4040
try:
4141
service_accounts.delete_service_account(unique_id)
4242
except HttpError as e:
43-
# When the service account doesn't exist, the service returns 403.
44-
if '403' in str(e):
45-
print("Ignoring 403 error upon cleanup.")
43+
# We've recently seen 404 error too.
44+
# It used to return 403, so we keep it too.
45+
if '403' in str(e) or '404' in str(e):
46+
print("Ignoring 404/403 error upon cleanup.")
4647
else:
4748
raise

0 commit comments

Comments
 (0)