From 378c763aa3fdc2d8dadde4778b37fe578b8388dd Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Wed, 30 Oct 2024 16:11:24 -0700 Subject: [PATCH] Fixed bug in `gam print group-members ... cachememberinfo` that caused a trap. --- docs/Cloud-Identity-Policies.md | 3 +++ docs/Domain-SharedContacts-GAL.md | 28 +++++------------------ docs/GamUpdates.md | 4 ++++ docs/How-to-Upgrade-Legacy-GAM-to-GAM7.md | 4 ++-- docs/Version-and-Help.md | 12 +++++----- src/GamUpdate.txt | 8 +++++-- src/gam/__init__.py | 9 ++++---- 7 files changed, 32 insertions(+), 36 deletions(-) diff --git a/docs/Cloud-Identity-Policies.md b/docs/Cloud-Identity-Policies.md index 211f7884..87845c22 100644 --- a/docs/Cloud-Identity-Policies.md +++ b/docs/Cloud-Identity-Policies.md @@ -11,7 +11,10 @@ ## Notes To use these commands you must update your client access authentication. +You'll enter 19R to turn on the Cloud Identity Policy scope; then continue +with authentication. ``` +gam oauth delete gam oauth create ... [R] 19) Cloud Identity - Policy diff --git a/docs/Domain-SharedContacts-GAL.md b/docs/Domain-SharedContacts-GAL.md index 81109418..d684e6b1 100644 --- a/docs/Domain-SharedContacts-GAL.md +++ b/docs/Domain-SharedContacts-GAL.md @@ -306,26 +306,10 @@ The `quotechar ` option allows you to choose an alternate quote chara `quotechar` defaults to `gam.cfg/csv_output_quote_char`. When uploading CSV files to Google, double quote `"` should be used. ## Display global address list -``` -gam info gal - [basic|full] - [fields ] [formatjson] -gam show gal - [basic|full] [orderby [ascending|descending]] - [fields ] [formatjson] -``` -By default, Gam displays the information as an indented list of keys and values. -* `formatjson` - Display the fields in JSON format. -``` -gam print gal [todrive *] - [basic|full] [orderby [ascending|descending]] - [fields ] [formatjson [quotechar ]] -``` -By default, Gam displays the information as columns of fields. -* `formatjson` - Display the fields in JSON format. +As of mid-October 2024, Google deprecated the API that retrieved the Global Address List. -By default, when writing CSV files, Gam uses a quote character of double quote `"`. The quote character is used to enclose columns that contain -the quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled. -When using the `formatjson` option, double quotes are used extensively in the data resulting in hard to read/process output. -The `quotechar ` option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output. -`quotechar` defaults to `gam.cfg/csv_output_quote_char`. When uploading CSV files to Google, double quote `"` should be used. +These commands are a work-around. +``` +gam config csv_output_row_filter "includeInGlobalAddressList:boolean:true" redirect csv ./UserGAL.csv print users fields name,gal +gam config csv_output_row_filter "includeInGlobalAddressList:boolean:true" batch_size 25 redirect csv ./GroupGAL.csv print groups fields name,gal +``` diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 4ecfba6d..e2a7d6c1 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,10 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation +### 7.00.33 + +Fixed bug in `gam print group-members ... cachememberinfo` that caused a trap. + ### 7.00.32 Updated `gam info policies` to accept different policy specifications: diff --git a/docs/How-to-Upgrade-Legacy-GAM-to-GAM7.md b/docs/How-to-Upgrade-Legacy-GAM-to-GAM7.md index 988d7b2a..570feb03 100644 --- a/docs/How-to-Upgrade-Legacy-GAM-to-GAM7.md +++ b/docs/How-to-Upgrade-Legacy-GAM-to-GAM7.md @@ -251,7 +251,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin$ gam version WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found -GAM 7.00.32 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.00.33 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.13.0 64-bit final MacOS Sonoma 14.5 x86_64 @@ -923,7 +923,7 @@ writes the credentials into the file oauth2.txt. C:\>del C:\GAMConfig\oauth2.txt C:\>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAM7 7.00.32 - https://github.com/GAM-team/GAM - pythonsource +GAM7 7.00.33 - https://github.com/GAM-team/GAM - pythonsource GAM Team Python 3.13.0 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index 07b0852c..d151d65e 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 -GAM 7.00.32 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.00.33 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.13.0 64-bit final MacOS Sonoma 14.5 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 -GAM 7.00.32 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.00.33 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.13.0 64-bit final MacOS Sonoma 14.5 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 -GAM 7.00.32 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.00.33 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.13.0 64-bit final MacOS Sonoma 14.5 x86_64 @@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gam7 Version Check: Current: 5.35.08 - Latest: 7.00.32 + Latest: 7.00.33 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -7.00.32 +7.00.33 ``` 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 7.00.32 - https://github.com/GAM-team/GAM +GAM 7.00.33 - https://github.com/GAM-team/GAM GAM Team Python 3.13.0 64-bit final MacOS Sonoma 14.5 x86_64 diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 4294ff14..0caf9a14 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -1,9 +1,13 @@ +7.00.33 + +Fixed bug in `gam print group-members ... cachememberinfo` that caused a trap. + 7.00.32 Updated `gam info policies` to accept different policy specifications: * `polices/` - A policy name, `policies/ahv4hg7qc24kvaghb7zihwf4riid4` -* `settings/` - A policy setting type, `settings/workspace_marketplace.apps_allowlist' -* `` - A policy setting type, `workspace_marketplace.apps_allowlist' +* `settings/` - A policy setting type, `settings/workspace_marketplace.apps_allowlist` +* `` - A policy setting type, `workspace_marketplace.apps_allowlist` 7.00.31 diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 209c4a5a..bb13ad7e 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki """ __author__ = 'GAM Team ' -__version__ = '7.00.32' +__version__ = '7.00.33' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' #pylint: disable=wrong-import-position @@ -33844,7 +33844,7 @@ def doPrintGroupMembers(): if userFieldsList: if not memberOptions[MEMBEROPTION_MEMBERNAMES] and 'name.fullName' in userFieldsList: memberOptions[MEMBEROPTION_MEMBERNAMES] = True - if memberOptions[MEMBEROPTION_MEMBERNAMES]: + if memberOptions[MEMBEROPTION_MEMBERNAMES] or cacheMemberInfo: if 'name.fullName' not in userFieldsList: userFieldsList.append('name.fullName') csvPF.AddTitles('name') @@ -33906,12 +33906,13 @@ def doPrintGroupMembers(): retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS, userKey=memberId, projection=schemaParms['projection'], customFieldMask=schemaParms['customFieldMask'], fields=userFields) + mname = mbinfo['name'].pop('fullName') if memberOptions[MEMBEROPTION_MEMBERNAMES]: - row['name'] = mbinfo['name'].pop('fullName') + row['name'] = mname if not mbinfo['name']: mbinfo.pop('name') if cacheMemberInfo: - memberNames[memberId] = row['name'] + memberNames[memberId] = mname if mbinfo: memberInfo[memberId] = mbinfo else: