Compare commits

...

2 Commits

Author SHA1 Message Date
Ross Scroggs
0c6825fa12 Updated gam [<UserTypeEntity>] show shareddriveacls ... formatjson
Some checks failed
Build and test GAM / build (Win64, build, 9, VC-WIN64A, windows-2022) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 3, linux-aarch64, [self-hosted linux arm64]) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 5, linux-aarch64, [self-hosted linux arm64], yes) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 7, darwin64-arm64, macos-14) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 8, darwin64-arm64, macos-15) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 1, linux-x86_64, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 2, linux-x86_64, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 4, linux-x86_64, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 6, darwin64-x86_64, macos-13) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 10, ubuntu-24.04, 3.9) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 11, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 12, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 13, ubuntu-24.04, 3.12) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
2024-12-27 19:27:04 -08:00
Ross Scroggs
6a82343668 Update gam-install.sh
Some checks are pending
Build and test GAM / build (Win64, build, 9, VC-WIN64A, windows-2022) (push) Waiting to run
Build and test GAM / build (aarch64, build, 3, linux-aarch64, [self-hosted linux arm64]) (push) Waiting to run
Build and test GAM / build (aarch64, build, 5, linux-aarch64, [self-hosted linux arm64], yes) (push) Waiting to run
Build and test GAM / build (aarch64, build, 7, darwin64-arm64, macos-14) (push) Waiting to run
Build and test GAM / build (aarch64, build, 8, darwin64-arm64, macos-15) (push) Waiting to run
Build and test GAM / build (x86_64, build, 1, linux-x86_64, ubuntu-22.04) (push) Waiting to run
Build and test GAM / build (x86_64, build, 2, linux-x86_64, ubuntu-24.04) (push) Waiting to run
Build and test GAM / build (x86_64, build, 4, linux-x86_64, ubuntu-22.04, yes) (push) Waiting to run
Build and test GAM / build (x86_64, build, 6, darwin64-x86_64, macos-13) (push) Waiting to run
Build and test GAM / build (x86_64, test, 10, ubuntu-24.04, 3.9) (push) Waiting to run
Build and test GAM / build (x86_64, test, 11, ubuntu-24.04, 3.10) (push) Waiting to run
Build and test GAM / build (x86_64, test, 12, ubuntu-24.04, 3.11) (push) Waiting to run
Build and test GAM / build (x86_64, test, 13, ubuntu-24.04, 3.12) (push) Waiting to run
Build and test GAM / merge (push) Blocked by required conditions
Build and test GAM / publish (push) Blocked by required conditions
CodeQL / Analyze (python) (push) Waiting to run
Check for Google Root CA Updates / check-apis (push) Waiting to run
2024-12-27 12:21:43 -08:00
3 changed files with 50 additions and 45 deletions

View File

@@ -1,3 +1,11 @@
7.02.05
Updated `gam [<UserTypeEntity>] show shareddriveacls ... formatjson` to not display this line
which interferes with the JSON output.
```
User: user@domain.com, Show N Shared Drives
```
7.02.04 7.02.04
Updated code to eliminate trap caused by bug introduced in 7.02.00 that occurs when an invalid domain or OU is specified. Updated code to eliminate trap caused by bug introduced in 7.02.00 that occurs when an invalid domain or OU is specified.

View File

@@ -381,7 +381,7 @@ while true; do
;; ;;
[Nn]*) [Nn]*)
# config_cmd="config no_browser true" # config_cmd="config no_browser true"
touch "$target_dir/gam/nobrowser.txt" > /dev/null 2>&1 touch "$target_dir/gam7/nobrowser.txt" > /dev/null 2>&1
break break
;; ;;
*) *)

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
""" """
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>' __author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.02.04' __version__ = '7.02.05'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position #pylint: disable=wrong-import-position
@@ -23171,8 +23171,8 @@ def printShowContactDelegates(users):
continue continue
jcount = len(delegates) jcount = len(delegates)
if not csvPF: if not csvPF:
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.CONTACT_DELEGATE, i, count)
if not csvStyle: if not csvStyle:
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.CONTACT_DELEGATE, i, count)
Ind.Increment() Ind.Increment()
j = 0 j = 0
for delegate in delegates: for delegate in delegates:
@@ -65568,31 +65568,29 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
else: else:
matchedFeed = feed matchedFeed = feed
jcount = len(matchedFeed) jcount = len(matchedFeed)
if jcount == 0:
setSysExitRC(NO_ENTITIES_FOUND_RC)
if not csvPF: if not csvPF:
if not FJQC.formatJSON: if not FJQC.formatJSON:
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.SHAREDDRIVE, i, count) entityPerformActionNumItems([Ent.USER, user], jcount, Ent.SHAREDDRIVE, i, count)
if jcount == 0: Ind.Increment()
setSysExitRC(NO_ENTITIES_FOUND_RC) j = 0
for shareddrive in matchedFeed:
j += 1
shareddrive = stripNonShowFields(shareddrive)
_showSharedDrive(user, shareddrive, j, jcount, FJQC)
Ind.Decrement()
else: else:
if not csvPF: for shareddrive in matchedFeed:
Ind.Increment() shareddrive = stripNonShowFields(shareddrive)
j = 0 if FJQC.formatJSON:
for shareddrive in matchedFeed: row = {'User': user, 'id': shareddrive['id'], 'name': shareddrive['name']}
j += 1 if not useDomainAdminAccess:
shareddrive = stripNonShowFields(shareddrive) row['role'] = shareddrive['role'] if not guiRoles else SHAREDDRIVE_API_GUI_ROLES_MAP[shareddrive['role']]
_showSharedDrive(user, shareddrive, j, jcount, FJQC) row['JSON'] = json.dumps(cleanJSON(shareddrive, timeObjects=SHAREDDRIVE_TIME_OBJECTS), ensure_ascii=False, sort_keys=True)
Ind.Decrement() csvPF.WriteRow(row)
else: else:
for shareddrive in matchedFeed: csvPF.WriteRowTitles(flattenJSON(shareddrive, flattened={'User': user}, timeObjects=SHAREDDRIVE_TIME_OBJECTS))
shareddrive = stripNonShowFields(shareddrive)
if FJQC.formatJSON:
row = {'User': user, 'id': shareddrive['id'], 'name': shareddrive['name']}
if not useDomainAdminAccess:
row['role'] = shareddrive['role'] if not guiRoles else SHAREDDRIVE_API_GUI_ROLES_MAP[shareddrive['role']]
row['JSON'] = json.dumps(cleanJSON(shareddrive, timeObjects=SHAREDDRIVE_TIME_OBJECTS), ensure_ascii=False, sort_keys=True)
csvPF.WriteRow(row)
else:
csvPF.WriteRowTitles(flattenJSON(shareddrive, flattened={'User': user}, timeObjects=SHAREDDRIVE_TIME_OBJECTS))
if csvPF: if csvPF:
csvPF.writeCSVfile('SharedDrives') csvPF.writeCSVfile('SharedDrives')
@@ -65651,29 +65649,27 @@ def doPrintShowOrgunitSharedDrives():
customer=_getCustomersCustomerIdWithC(), customer=_getCustomersCustomerIdWithC(),
filter="type == 'shared_drive'") filter="type == 'shared_drive'")
jcount = len(sds) jcount = len(sds)
if jcount == 0:
setSysExitRC(NO_ENTITIES_FOUND_RC)
if not csvPF: if not csvPF:
if not FJQC.formatJSON: if not FJQC.formatJSON:
entityPerformActionNumItems([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], jcount, Ent.SHAREDDRIVE) entityPerformActionNumItems([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], jcount, Ent.SHAREDDRIVE)
if jcount == 0: Ind.Increment()
setSysExitRC(NO_ENTITIES_FOUND_RC) j = 0
for shareddrive in sds:
j += 1
_getOrgUnitSharedDriveInfo(shareddrive)
_showOrgUnitSharedDrive(shareddrive, j, jcount, FJQC)
Ind.Decrement()
else: else:
if not csvPF: for shareddrive in sds:
Ind.Increment() _getOrgUnitSharedDriveInfo(shareddrive)
j = 0 if FJQC.formatJSON:
for shareddrive in sds: row = {'name': shareddrive['name']}
j += 1 row['JSON'] = json.dumps(cleanJSON(shareddrive), ensure_ascii=False, sort_keys=True)
_getOrgUnitSharedDriveInfo(shareddrive) csvPF.WriteRow(row)
_showOrgUnitSharedDrive(shareddrive, j, jcount, FJQC) else:
Ind.Decrement() csvPF.WriteRowTitles(flattenJSON(shareddrive))
else:
for shareddrive in sds:
_getOrgUnitSharedDriveInfo(shareddrive)
if FJQC.formatJSON:
row = {'name': shareddrive['name']}
row['JSON'] = json.dumps(cleanJSON(shareddrive), ensure_ascii=False, sort_keys=True)
csvPF.WriteRow(row)
else:
csvPF.WriteRowTitles(flattenJSON(shareddrive))
if csvPF: if csvPF:
csvPF.writeCSVfile('OrgUnit {orgUnitPath} SharedDrives') csvPF.writeCSVfile('OrgUnit {orgUnitPath} SharedDrives')
@@ -65758,7 +65754,7 @@ SHOW_NO_PERMISSIONS_DRIVES_CHOICE_MAP = {
# [oneitemperrow] [maxitems <Integer>] # [oneitemperrow] [maxitems <Integer>]
# [shownopermissionsdrives false|true|only] # [shownopermissionsdrives false|true|only]
# [<DrivePermissionsFieldName>*|(fields <DrivePermissionsFieldNameList>)] # [<DrivePermissionsFieldName>*|(fields <DrivePermissionsFieldNameList>)]
# [formatjsn] # [formatjson]
def printShowSharedDriveACLs(users, useDomainAdminAccess=False): def printShowSharedDriveACLs(users, useDomainAdminAccess=False):
def _printPermissionRow(baserow, permission): def _printPermissionRow(baserow, permission):
row = baserow.copy() row = baserow.copy()
@@ -65948,7 +65944,8 @@ def printShowSharedDriveACLs(users, useDomainAdminAccess=False):
if jcount == 0: if jcount == 0:
setSysExitRC(NO_ENTITIES_FOUND_RC) setSysExitRC(NO_ENTITIES_FOUND_RC)
if not csvPF: if not csvPF:
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.SHAREDDRIVE, i, count) if not FJQC.formatJSON:
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.SHAREDDRIVE, i, count)
Ind.Increment() Ind.Increment()
j = 0 j = 0
for shareddrive in matchFeed: for shareddrive in matchFeed: