diff --git a/docs/CSV-Output-Filtering.md b/docs/CSV-Output-Filtering.md index 6cad6474..2d2519c1 100644 --- a/docs/CSV-Output-Filtering.md +++ b/docs/CSV-Output-Filtering.md @@ -171,32 +171,39 @@ primaryEmail,externalIds,externalIds.0.type,externalIds.0.value,externalIds.1.ty You can include rows generated by gam print commands based on column values. You specify a list of fields (headers) and the values they must have. `csv_output_row_filter` is used to specify the fields and values. Each field name/expression can appear only once in the list. - -You specify whether all or any value filters must match for the row to be included in the output. - -* `csv_output_row_filter_mode allmatch` - All value filters must match for the row to be included in the output; this is the default -* `csv_output_row_filter_mode anymatch` - Any value filter must match for the row to be included in the output - ``` gam config csv_output_row_filter ... gam config csv_output_row_filter ... ``` +You optionally specify whether all or any value filters must match for the row to be included in the output. + +* `csv_output_row_filter_mode allmatch` - All value filters must match for the row to be included in the output; this is the default +* `csv_output_row_filter_mode anymatch` - Any value filter must match for the row to be included in the output +``` +gam config csv_output_row_filter_mode anymatch csv_output_row_filter ... +gam config csv_output_row_filter_mode anymatch csv_output_row_filter ... +``` + + ### Exclusive filters You can exclude rows generated by gam print commands based on column values. You specify a list of fields (headers) and the values they must not have. `csv_output_row_drop_filter` is used to specify the fields and values. Each field name/expression can appear only once in the list. - -You specify whether all or any value filters must match for the row to be excluded from the output. - -* `csv_output_row_filter_drop_mode allmatch` - If all value filters match, the row is excluded from the output -* `csv_output_row_filter_drop_mode anymatch` - If any value filter matches, the row is excluded from the output; this is the default - ``` gam config csv_output_row_drop_filter ... gam config csv_output_row_drop_filter ... ``` +You optionally specify whether all or any value filters must match for the row to be excluded from the output. + +* `csv_output_row_filter_drop_mode allmatch` - If all value filters match, the row is excluded from the output +* `csv_output_row_filter_drop_mode anymatch` - If any value filter matches, the row is excluded from the output; this is the default +``` +gam config csv_output_row_filter_drop_mode allmatch csv_output_row_drop_filter ... +gam config csv_output_row_filter_drop_mode allmatch csv_output_row_drop_filter ... +``` + ### Matches A filter matches if the field has the desired value. lf you specify a regular expression for a field name that matches several columns, the filter matches if any of the columns has a match. In the case of `notregex|notregexcs|notdata`, diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 7fba8a34..0c92dd52 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,17 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation. +### 6.63.16 + +Arguments `noinherit`, `blockinheritance` and `blockinheritance true` have been removed from the following +commands due to an upcoming API change that no longer allows blocking OU setting inheritance. +Arguments `inherit` and `blockinheritance false` are still valid. +``` +gam create org +gam update org +gam update orgs +``` + ### 6.63.15 Added `print_cros_ous` and `print_cros_ous_and_children` variables to `gam.cfg` that provide a default list of OUs for these commands: diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index b240fc82..913729c2 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -333,7 +333,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found -GAMADV-XTD3 6.63.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.63.16 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.10.8 64-bit final MacOS High Sierra 10.13.6 x86_64 @@ -981,7 +981,7 @@ writes the credentials into the file oauth2.txt. C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt C:\GAMADV-XTD3>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 6.63.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.63.16 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.11.5 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Organizational-Units.md b/docs/Organizational-Units.md index 52eccc55..78cae505 100644 --- a/docs/Organizational-Units.md +++ b/docs/Organizational-Units.md @@ -70,15 +70,17 @@ See: [List Items](List-Items) Create, update and delete organization units. ``` gam create org|ou [description ] - [parent ] [inherit|noinherit|(blockinheritance )] + [parent ] [inherit|(blockinheritance False)] [buildpath] gam update org|ou [name ] [description ] - [parent ] [inherit|noinherit|(blockinheritance )] + [parent ] [inherit|(blockinheritance False)] gam delete org|ou gam update orgs|ous [name ] [description ] - [parent ] [inherit|noinherit|(blockinheritance )] + [parent ] [inherit|(blockinheritance False)] gam delete orgs|ous ``` +Inheritance specifies whether sub-OUs of the specified OU inherit its settings. +* `inherit|blockinheritance false` - Sub-OUs inherit settings from the specified OU; this is the default ## Add users to an organizational unit When adding users to an OU, Gam uses a batch method to speed up processing. diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index 8a95df0d..d2e7b885 100644 --- a/docs/Version-and-Help.md +++ b/docs/Version-and-Help.md @@ -3,7 +3,7 @@ Print the current version of Gam with details ``` gam version -GAMADV-XTD3 6.63.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.63.16 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.11.5 64-bit final MacOS Monterey 12.6.6 x86_64 @@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00 Print the current version of Gam with details and time offset information ``` gam version timeoffset -GAMADV-XTD3 6.63.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.63.16 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.11.5 64-bit final MacOS Monterey 12.6.6 x86_64 @@ -27,7 +27,7 @@ Your system time differs from www.googleapis.com by less than 1 second Print the current version of Gam with extended details and SSL information ``` gam version extended -GAMADV-XTD3 6.63.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.63.16 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.11.5 64-bit final MacOS Monterey 12.6.6 x86_64 @@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 6.63.15 + Latest: 6.63.16 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -6.63.15 +6.63.16 ``` In Linux/MacOS you can do: ``` @@ -82,7 +82,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 6.63.15 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.63.16 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.11.5 64-bit final MacOS Monterey 12.6.6 x86_64 diff --git a/src/GamCommands.txt b/src/GamCommands.txt index ee9c4313..a3848681 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -3988,15 +3988,15 @@ gam print mobile [todrive *] path|orgunitpath ::= "(,)*" -gam create|add org|ou [description ] [parent ] [inherit|noinherit|(blockinheritance )] [buildpath] -gam update org|ou [name ] [description ] [parent ] [inherit|noinherit|(blockinheritance )] +gam create|add org|ou [description ] [parent ] [inherit|(blockinheritance False)] [buildpath] +gam update org|ou [name ] [description ] [parent ] [inherit|(blockinheritance False)] gam update org|ou add|move [quickcrosmove []] gam update org|ou add|move gam update org|ou sync [removetoou ] [quickcrosmove []] gam update org|ou sync [removetoou ] gam delete org|ou -gam update orgs|ous [name ] [description ] [parent ] [inherit|noinherit|(blockinheritance )] +gam update orgs|ous [name ] [description ] [parent ] [inherit|(blockinheritance False)] gam update orgs|ous add|move [quickcrosmove []] gam update orgs|ous add|move gam update orgs|ous sync [removetoou ] [quickcrosmove []] diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 587fbc41..be13841d 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,17 @@ Merged GAM-Team version +6.63.16 + +Arguments `noinherit`, `blockinheritance` and `blockinheritance true` have been removed from the following +commands due to an upcoming API change that no longer allows blocking OU setting inheritance. +Arguments `inherit` and `blockinheritance false` are still valid. +``` +gam create org +gam update org +gam update orgs +``` + 6.63.15 Added `print_cros_ous` and `print_cros_ous_and_children` variables to `gam.cfg` that provide a default list of OUs for these commands: diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 4c39cc30..4cba0379 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -801,6 +801,9 @@ def deprecatedArgument(argument): Cmd.Advance() stderrWarningMsg(f'{Cmd.ARGUMENT_ERROR_NAMES[Cmd.ARGUMENT_DEPRECATED][1]}: {Msg.IGNORED} <{argument}>') +def deprecatedArgumentExit(argument): + usageErrorExit(f'{Cmd.ARGUMENT_ERROR_NAMES[Cmd.ARGUMENT_DEPRECATED][1]}: <{argument}>') + # Choices is the valid set of choices that was expected def formatChoiceList(choices): choiceList = [c if c else "''" for c in choices] @@ -15888,7 +15891,7 @@ def doCreateAdmin(): result = callGAPI(cd.roleAssignments(), 'insert', throwReasons=[GAPI.INTERNAL_ERROR, GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.CUSTOMER_EXCEEDED_ROLE_ASSIGNMENTS_LIMIT, GAPI.SERVICE_NOT_AVAILABLE, - GAPI.INVALID_ORGUNIT, GAPI.DUPLICATE], + GAPI.INVALID_ORGUNIT, GAPI.DUPLICATE, GAPI.CONDITION_NOT_MET], retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS, customer=GC.Values[GC.CUSTOMER_ID], body=body, fields='roleAssignmentId,assigneeType') assigneeType = result.get('assigneeType') @@ -15904,7 +15907,7 @@ def doCreateAdmin(): pass except (GAPI.badRequest, GAPI.customerNotFound): accessErrorExit(cd) - except (GAPI.forbidden, GAPI.customerExceededRoleAssignmentsLimit, GAPI.serviceNotAvailable) as e: + except (GAPI.forbidden, GAPI.customerExceededRoleAssignmentsLimit, GAPI.serviceNotAvailable, GAPI.conditionNotMet) as e: entityActionFailedWarning([Ent.ADMINISTRATOR, user, Ent.ADMIN_ROLE, role], str(e)) except GAPI.invalidOrgunit: entityActionFailedWarning([Ent.ADMINISTRATOR, user], Msg.INVALID_ORGUNIT) @@ -16306,7 +16309,23 @@ def doShowTransferApps(): Ind.Decrement() Ind.Decrement() -# gam create org|ou [description ] [parent ] [inherit|noinherit|(blockinheritance )] [buildpath] +def _getOrgInheritance(myarg, body): + if myarg == 'noinherit': + Cmd.Backup() + deprecatedArgumentExit(myarg) + elif myarg == 'inherit': + body['blockInheritance'] = False + elif myarg in {'blockinheritance', 'inheritanceblocked'}: + location = Cmd.Location()-1 + if getBoolean(): + Cmd.SetLocation(location) + deprecatedArgumentExit(myarg) + body['blockInheritance'] = False + else: + return False + return True + +# gam create org|ou [description ] [parent ] [inherit|(blockinheritance False)] [buildpath] def doCreateOrg(): def _createOrg(body, parentPath, fullPath): @@ -16335,12 +16354,8 @@ def doCreateOrg(): body['description'] = getStringWithCRsNLs() elif myarg == 'parent': parent = getOrgUnitItem() - elif myarg == 'noinherit': - body['blockInheritance'] = True - elif myarg == 'inherit': - body['blockInheritance'] = False - elif myarg in {'blockinheritance', 'inheritanceblocked'}: - body['blockInheritance'] = getBoolean() + elif _getOrgInheritance(myarg, body): + pass elif myarg == 'buildpath': buildPath = True else: @@ -16624,12 +16639,8 @@ def _doUpdateOrgs(entityList): body['parentOrgUnitId'] = parent else: body['parentOrgUnitPath'] = parent - elif myarg == 'noinherit': - body['blockInheritance'] = True - elif myarg == 'inherit': - body['blockInheritance'] = False - elif myarg in {'blockinheritance', 'inheritanceblocked'}: - body['blockInheritance'] = getBoolean() + elif _getOrgInheritance(myarg, body): + pass else: unknownArgumentExit() i = 0 @@ -16649,7 +16660,7 @@ def _doUpdateOrgs(entityList): except (GAPI.badRequest, GAPI.invalidCustomerId, GAPI.loginRequired): checkEntityAFDNEorAccessErrorExit(cd, Ent.ORGANIZATIONAL_UNIT, orgUnitPath) -# gam update orgs|ous [name ] [description ] [parent ] [inherit|noinherit|(blockinheritance )] +# gam update orgs|ous [name ] [description ] [parent ] [inherit|(blockinheritance False)] # gam update orgs|ous add|move [quickcrosmove []] # gam update orgs|ous add|move # gam update orgs|ous sync [removetoou ] [quickcrosmove []] @@ -16657,7 +16668,7 @@ def _doUpdateOrgs(entityList): def doUpdateOrgs(): _doUpdateOrgs(getEntityList(Cmd.OB_ORGUNIT_ENTITY, shlexSplit=True)) -# gam update org|ou [name ] [description ] [parent ] [inherit|noinherit|(blockinheritance )] +# gam update org|ou [name ] [description ] [parent ] [inherit|(blockinheritance False)] # gam update org|ou add|move [quickcrosmove []] # gam update org|ou add|move # gam update org|ou sync [removetoou ] [quickcrosmove []] diff --git a/src/gam/gamlib/glverlibs.py b/src/gam/gamlib/glverlibs.py index d0c19562..f2620a98 100644 --- a/src/gam/gamlib/glverlibs.py +++ b/src/gam/gamlib/glverlibs.py @@ -29,6 +29,5 @@ GAM_VER_LIBS = ['cryptography', 'httplib2', 'passlib', 'python-dateutil', - 'urllib3', 'yubikey-manager', ]