mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
Updated gam delete ou and gam print admins to handle the following error:
ERROR: 503: serviceNotAvailable - The service is currently unavailable.
This commit is contained in:
@@ -8,6 +8,11 @@ where 7.00.02 MacOS builds usually took ~7 seconds to run "gam version", 7.00.03
|
|||||||
MacOS builds are now signed by Jay's Apple Developer ID and notarized (scanned for malware) by Apple. This
|
MacOS builds are now signed by Jay's Apple Developer ID and notarized (scanned for malware) by Apple. This
|
||||||
should resolve MacOS security warnings that need to be overridden when running GAM.
|
should resolve MacOS security warnings that need to be overridden when running GAM.
|
||||||
|
|
||||||
|
Updated `gam delete ou` and `gam print admins` to handle the following error:
|
||||||
|
```
|
||||||
|
ERROR: 503: serviceNotAvailable - The service is currently unavailable.
|
||||||
|
```
|
||||||
|
|
||||||
7.00.02
|
7.00.02
|
||||||
|
|
||||||
Added option `showlastmodification` to `gam <UserTypeEntity> print|show filecounts` that adds
|
Added option `showlastmodification` to `gam <UserTypeEntity> print|show filecounts` that adds
|
||||||
|
|||||||
@@ -16623,13 +16623,15 @@ def doPrintShowAdmins():
|
|||||||
try:
|
try:
|
||||||
admins = callGAPIpages(cd.roleAssignments(), 'list', 'items',
|
admins = callGAPIpages(cd.roleAssignments(), 'list', 'items',
|
||||||
pageMessage=getPageMessage(),
|
pageMessage=getPageMessage(),
|
||||||
throwReasons=[GAPI.INVALID, GAPI.USER_NOT_FOUND, GAPI.BAD_REQUEST,
|
throwReasons=[GAPI.INVALID, GAPI.USER_NOT_FOUND,
|
||||||
GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN],
|
GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE,
|
||||||
|
GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND],
|
||||||
|
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
||||||
customer=GC.Values[GC.CUSTOMER_ID], fields=fields, **kwargs)
|
customer=GC.Values[GC.CUSTOMER_ID], fields=fields, **kwargs)
|
||||||
except (GAPI.invalid, GAPI.userNotFound):
|
except (GAPI.invalid, GAPI.userNotFound):
|
||||||
entityUnknownWarning(Ent.ADMINISTRATOR, userKey)
|
entityUnknownWarning(Ent.ADMINISTRATOR, userKey)
|
||||||
return
|
return
|
||||||
except GAPI.forbidden as e:
|
except (GAPI.forbidden, GAPI.serviceNotAvailable) as e:
|
||||||
entityActionFailedExit([Ent.ADMINISTRATOR, userKey, Ent.ADMIN_ROLE, roleId], str(e))
|
entityActionFailedExit([Ent.ADMINISTRATOR, userKey, Ent.ADMIN_ROLE, roleId], str(e))
|
||||||
except (GAPI.badRequest, GAPI.customerNotFound):
|
except (GAPI.badRequest, GAPI.customerNotFound):
|
||||||
accessErrorExit(cd)
|
accessErrorExit(cd)
|
||||||
@@ -17334,14 +17336,17 @@ def _doDeleteOrgs(entityList):
|
|||||||
try:
|
try:
|
||||||
orgUnitPath = makeOrgUnitPathAbsolute(orgUnitPath)
|
orgUnitPath = makeOrgUnitPathAbsolute(orgUnitPath)
|
||||||
callGAPI(cd.orgunits(), 'delete',
|
callGAPI(cd.orgunits(), 'delete',
|
||||||
throwReasons=[GAPI.CONDITION_NOT_MET, GAPI.INVALID_ORGUNIT, GAPI.ORGUNIT_NOT_FOUND, GAPI.BACKEND_ERROR, GAPI.BAD_REQUEST, GAPI.INVALID_CUSTOMER_ID, GAPI.LOGIN_REQUIRED],
|
throwReasons=[GAPI.CONDITION_NOT_MET, GAPI.INVALID_ORGUNIT, GAPI.ORGUNIT_NOT_FOUND, GAPI.BACKEND_ERROR,
|
||||||
|
GAPI.INVALID_CUSTOMER_ID, GAPI.SERVICE_NOT_AVAILABLE,
|
||||||
|
GAPI.BAD_REQUEST, GAPI.LOGIN_REQUIRED],
|
||||||
|
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
||||||
customerId=GC.Values[GC.CUSTOMER_ID], orgUnitPath=encodeOrgUnitPath(makeOrgUnitPathRelative(orgUnitPath)))
|
customerId=GC.Values[GC.CUSTOMER_ID], orgUnitPath=encodeOrgUnitPath(makeOrgUnitPathRelative(orgUnitPath)))
|
||||||
entityActionPerformed([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], i, count)
|
entityActionPerformed([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], i, count)
|
||||||
except GAPI.conditionNotMet:
|
except GAPI.conditionNotMet:
|
||||||
entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], Msg.HAS_CHILD_ORGS.format(Ent.Plural(Ent.ORGANIZATIONAL_UNIT)), i, count)
|
entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], Msg.HAS_CHILD_ORGS.format(Ent.Plural(Ent.ORGANIZATIONAL_UNIT)), i, count)
|
||||||
except (GAPI.invalidOrgunit, GAPI.orgunitNotFound, GAPI.backendError):
|
except (GAPI.invalidOrgunit, GAPI.orgunitNotFound, GAPI.backendError):
|
||||||
entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], Msg.DOES_NOT_EXIST, i, count)
|
entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], Msg.DOES_NOT_EXIST, i, count)
|
||||||
except GAPI.invalidCustomerId as e:
|
except (GAPI.invalidCustomerId, GAPI.serviceNotAvailable) as e:
|
||||||
### Check for my_customer
|
### Check for my_customer
|
||||||
entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath, Ent.CUSTOMER_ID, GC.Values[GC.CUSTOMER_ID]], str(e), i, count)
|
entityActionFailedWarning([Ent.ORGANIZATIONAL_UNIT, orgUnitPath, Ent.CUSTOMER_ID, GC.Values[GC.CUSTOMER_ID]], str(e), i, count)
|
||||||
except (GAPI.badRequest, GAPI.loginRequired):
|
except (GAPI.badRequest, GAPI.loginRequired):
|
||||||
|
|||||||
Reference in New Issue
Block a user