retry false daily limit errors on org create

This commit is contained in:
Jay Lee
2020-03-13 07:37:51 -04:00
parent 5d02d73737
commit 357c295fec
2 changed files with 3 additions and 1 deletions

View File

@@ -7252,7 +7252,8 @@ def doCreateOrg():
body['parentOrgUnitPath'] = '/'
body['name'] = orgUnitPath[1:]
parent = body['parentOrgUnitPath']
gapi.call(cd.orgunits(), 'insert', customerId=GC_Values[GC_CUSTOMER_ID], body=body)
gapi.call(cd.orgunits(), 'insert', customerId=GC_Values[GC_CUSTOMER_ID], body=body, retry_reasons=[gapi.errors.ErrorReason.DAILY_LIMIT_EXCEEDED])
print(f'Created OrgUnit {body["name"]}')
def doUpdateUser(users, i):
cd = buildGAPIObject('directory')

View File

@@ -134,6 +134,7 @@ class ErrorReason(Enum):
SYSTEM_ERROR = 'systemError'
USER_NOT_FOUND = 'userNotFound'
USER_RATE_LIMIT_EXCEEDED = 'userRateLimitExceeded'
DAILY_LIMIT_EXCEEDED = 'dailyLimitExceeded'
def __str__(self):
return str(self.value)