From 68863cd44bfde443c2976a1804d7b75cc9117c85 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Thu, 5 Sep 2024 19:19:45 -0700 Subject: [PATCH] Updated `gam create inboundssoprofile ... returnnameonly` to return `inProgress` if the API does not return a complete result. --- .github/workflows/build.yml | 16 +++++++++------- docs/ChromeOS-Devices.md | 2 +- docs/GamUpdates.md | 10 ++++++++++ docs/How-to-Upgrade-from-Standard-GAM.md | 4 ++-- docs/Reports.md | 12 ++++++++++++ docs/Shared-Drives.md | 11 ++++++----- docs/Version-and-Help.md | 12 ++++++------ src/GamUpdate.txt | 6 +++++- src/gam/__init__.py | 6 ++++-- 9 files changed, 55 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b721022b..22a4cb75 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -554,10 +554,10 @@ jobs: echo "EXE data FROM build/gam/EXE-00.toc" cat build/gam/EXE-00.toc if [ -x "$(command -v realpath)" ]; then - realpath=realpath + realpath=realpath else - brew install coreutils - realpath=grealpath + brew install coreutils + realpath=grealpath fi export gam=$(realpath "$gam") if [[ "${RUNNER_OS}" == "Windows" ]]; then @@ -850,10 +850,12 @@ jobs: $gam user $gam_user delete shareddrive "${driveid}" nukefromorbit echo "printer model count:" ssoprofile=$($gam create inboundssoprofile name "El Goog ${newbase}" loginurl https://www.google.com logouturl https://www.google.com changepasswordurl https://www.google.com entityid ElGoog return_name_only) - $gam create inboundssocredential profile "id:${ssoprofile}" generate_key - #$gam create inboundssoassignment profile "id:${ssoprofile}" orgunit "${newou}" mode SAML_SSO - #$gam delete inboundssoassignment "orgunit:${newou}" - $gam delete inboundssoprofile "id:${ssoprofile}" + if [ ${ssoprofile} != 'inProgress' ]; then + $gam create inboundssocredential profile "id:${ssoprofile}" generate_key + #$gam create inboundssoassignment profile "id:${ssoprofile}" orgunit "${newou}" mode SAML_SSO + #$gam delete inboundssoassignment "orgunit:${newou}" + $gam delete inboundssoprofile "id:${ssoprofile}" + fi $gam print printermodels | wc -l $gam print printers printerid=$($gam create printer displayname "${newbase}" uri ipp://localhost:631 driverless description "made by $(gam_user)" ou "${newou}" nodetails | awk '{print substr($2, 1, length($2)-1)}') diff --git a/docs/ChromeOS-Devices.md b/docs/ChromeOS-Devices.md index dc3f7868..2a918bfb 100644 --- a/docs/ChromeOS-Devices.md +++ b/docs/ChromeOS-Devices.md @@ -391,7 +391,7 @@ given if invalid CrOS deviceIds are specified. ### Example: Add ChromeOS devices to a single OU Suppose you have a CSV file cros.csv with a single column: deviceId ``` -gam update ou /Students/2022 add cros_csvfile cros.csv:deviceId quickcrosmove +gam update ou /Students/2022 add croscsvfile cros.csv:deviceId quickcrosmove ``` ### Example: Add ChromeOS devices to multiple OUs diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 29385900..cc98051c 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,16 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads-Installs](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads-Installs) for Windows or other options, including manual installation +### 6.80.19 + +Fixed bug in `gam create inboundssoprofile` that caused a trap due to +an unexpected API result. + +Updated `gam create inboundssoprofile ... returnnameonly` to return `inProgress` if the API +does not return a complete result. + +Upgraded to OpenSSL 3.3.2 where possible. + ### 6.80.18 Updated `gam print|show admins` to handle the following error: diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index 2ac7350e..787eb894 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.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 -GAMADV-XTD3 6.80.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.80.19 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 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 -GAMADV-XTD3 6.80.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.80.19 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Reports.md b/docs/Reports.md index 12302f9e..3afe3898 100644 --- a/docs/Reports.md +++ b/docs/Reports.md @@ -2,6 +2,7 @@ - [API documentation](#api-documentation) - [Collections of Users](Collections-of-Users) - [Definitions](#definitions) +- [Special quoting](#special-quoting) - [Activity reports](#activity-reports) - [Find Shared Drives with no activity](#find-shared-drives-with-no-activity) - [Customer and user reports parameters](#customer-and-user-reports-parameters) @@ -24,6 +25,17 @@ never| now|today ``` +## Special quoting +If you are going to use `config csv_output_row_filter` when printing reports, +you'll need special quoting in the filter because of the `:` characters in the parameter names. + +See: https://github.com/taers232c/GAMADV-XTD3/wiki/CSV-Output-Filtering#quoting-rules + +For example: +``` +config csv_output_row_filter "'\"accounts:used_quota_in_mb\":count>15000'" +``` + ## Activity reports ``` ::= diff --git a/docs/Shared-Drives.md b/docs/Shared-Drives.md index 42a17648..dcc5d96c 100644 --- a/docs/Shared-Drives.md +++ b/docs/Shared-Drives.md @@ -13,6 +13,7 @@ - [Change Shared Drive visibility](#change-shared-drive-visibility) - [Display Shared Drives](#display-shared-drives) - [Display List of Shared Drives in an Organizational Unit](#display-list-of-shared-drives-in-an-organizational-unit) +- [Display all Shared Drives with no organizers](#display-all-shared-drives-with-no-organizers) - [Display all Shared Drives with a specific organizer](#display-all-shared-drives-with-a-specific-organizer) - [Display all Shared Drives without a specific organizer](#display-all-shared-drives-without-a-specific-organizer) - [Manage Shared Drive access](#manage-shared-drive-access) @@ -389,15 +390,15 @@ Print information about all Shared Drives in the organization. gam print teamdrives gam user admin@domain.com print teamdrives adminaccess ``` -Print information about all Shared Drives in the organization with no organizers. -``` -gam print teamdrives query "organizerCount = 0" -gam user admin@domain.com print teamdrives adminaccess teamdriveadminquery "organizerCount = 0" -``` Print information about Shared Drives that have admin@domain.com as a member. ``` gam user admin@domain.com print teamdrives ``` +## Display all Shared Drives with no organizers +``` +gam print teamdrives query "organizerCount = 0" +``` + ## Display all Shared Drives with a specific organizer Substitute actual email address for `organizer@domain.com`. ``` diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index 70011ac9..69b960de 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.80.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.80.19 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 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 -GAMADV-XTD3 6.80.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.80.19 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 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 -GAMADV-XTD3 6.80.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.80.19 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 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/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 6.80.18 + Latest: 6.80.19 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -6.80.18 +6.80.19 ``` 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.80.18 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.80.19 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 08728783..5c271a76 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -4,7 +4,11 @@ Merged GAM-Team version 6.80.19 -Fixed bug in `gam create inboundssoprofile` that caused a trap. +Fixed bug in `gam create inboundssoprofile` that caused a trap due to +an unexpected API result. + +Updated `gam create inboundssoprofile ... returnnameonly` to return `inProgress` if the API +does not return a complete result. Upgraded to OpenSSL 3.3.2 where possible. diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 047dbf3b..00a3d33e 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -44577,8 +44577,10 @@ def _processInboundSSOProfileResult(result, returnNameOnly, kvlist, function): entityActionPerformed(kvlist) else: entityActionFailedWarning(kvlist, result['error']['message']) - else: + elif not returnNameOnly: entityActionPerformedMessage(kvlist, Msg.ACTION_IN_PROGRESS.format(f'{function} inboundssoprofile')) + else: + writeStdout('inProgress\n') # gam create inboundssoprofile [name ] # [entityid ] [loginurl ] [logouturl ] [changepasswordurl ] @@ -44741,7 +44743,7 @@ def _showInboundSSOCredentials(credentials, FJQC, i=0, count=0): Ind.Decrement() def _processInboundSSOCredentialsResult(result, kvlist, function): - if result['done']: + if result.get('done', False): if 'error' not in result: if 'response' in result: _showInboundSSOCredentials(result['response'], None)