Compare commits

...

2 Commits

Author SHA1 Message Date
Ross Scroggs
e2f0afe891 Handle API additional errors in update events 2025-05-23 09:26:30 -07:00
Ross Scroggs
65cd2439d5 Fixed bug in gam <UserTypeEntity> print filelist ... countsonly
Some checks failed
Push wiki / pushwiki (push) Has been cancelled
2025-05-22 09:37:30 -07:00
6 changed files with 44 additions and 32 deletions

View File

@@ -1,3 +1,11 @@
7.07.09
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
to handle the following error:
```
gamlib.glgapi.serviceNotAvailable: Authentication backend unavailable.
```
7.07.08
Fixed bug in `gam <UserTypeEntity> print filelist ... countsonly` that issued an

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.07.08'
__version__ = '7.07.09'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position
@@ -8962,7 +8962,7 @@ class CSVPrintFile():
return
if self.zeroBlankMimeTypeCounts:
self.ZeroBlankMimeTypeCounts()
if self.rowFilter or self.rowDropFilter:
if not clearRowFilters and (self.rowFilter or self.rowDropFilter):
self.CheckOutputRowFilterHeaders()
if self.headerFilter or self.headerDropFilter:
if not self.formatJSON:
@@ -14357,6 +14357,7 @@ def doReport():
else:
if eventRowFilter:
csvPF.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
csvPF.SetRowDropFilter([], GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER_MODE])
if not countsSummary:
titles = ['emailAddress']
if countsOnly and countsByDate:
@@ -39264,7 +39265,8 @@ def _updateCalendarEvents(origUser, user, origCal, calIds, count, calendarEventE
try:
if updateFieldList:
event = callGAPI(cal.events(), 'get',
throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.NOT_FOUND, GAPI.DELETED, GAPI.FORBIDDEN],
throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.NOT_FOUND, GAPI.DELETED, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR],
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS+[GAPI.BACKEND_ERROR],
calendarId=calId, eventId=eventId, fields=updateFields)
if 'description' in updateFieldList and 'description' in event:
body['description'] = event['description']
@@ -39294,10 +39296,11 @@ def _updateCalendarEvents(origUser, user, origCal, calIds, count, calendarEventE
if parameters['clearResources']:
body['attendees'] = [attendee for attendee in body['attendees'] if not attendee['email'].lower().endswith('@resource.calendar.google.com')]
event = callGAPI(cal.events(), 'patch',
throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.NOT_FOUND, GAPI.DELETED, GAPI.FORBIDDEN,
throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.NOT_FOUND, GAPI.DELETED, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR,
GAPI.INVALID, GAPI.REQUIRED, GAPI.TIME_RANGE_EMPTY, GAPI.EVENT_DURATION_EXCEEDS_LIMIT,
GAPI.REQUIRED_ACCESS_LEVEL, GAPI.CANNOT_CHANGE_ORGANIZER_OF_INSTANCE,
GAPI.MALFORMED_WORKING_LOCATION_EVENT],
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS+[GAPI.BACKEND_ERROR],
calendarId=calId, eventId=eventId, conferenceDataVersion=1, sendUpdates=parameters['sendUpdates'], supportsAttachments=True,
body=body, fields=pfields)
if parameters['csvPF'] is None:
@@ -39311,7 +39314,7 @@ def _updateCalendarEvents(origUser, user, origCal, calIds, count, calendarEventE
entityUnknownWarning(Ent.CALENDAR, calId, j, jcount)
break
entityActionFailedWarning([Ent.CALENDAR, calId, Ent.EVENT, eventId], str(e), j, jcount)
except (GAPI.forbidden, GAPI.invalid, GAPI.required, GAPI.timeRangeEmpty, GAPI.eventDurationExceedsLimit,
except (GAPI.forbidden, GAPI.backendError, GAPI.invalid, GAPI.required, GAPI.timeRangeEmpty, GAPI.eventDurationExceedsLimit,
GAPI.requiredAccessLevel, GAPI.cannotChangeOrganizerOfInstance, GAPI.malformedWorkingLocationEvent) as e:
entityActionFailedWarning([Ent.CALENDAR, calId, Ent.EVENT, eventId], str(e), j, jcount)
except GAPI.notACalendarUser:
@@ -39934,7 +39937,6 @@ def doCalendarsPrintShowEvents(calIds):
csvPF, FJQC, fieldsList)
if csvPF:
if calendarEventEntity['countsOnly'] and calendarEventEntity['eventRowFilter']:
csvPF.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
csvPF.SetTitles(calendarEventEntity['countsOnlyTitles'])
csvPF.writeCSVfile('Calendar Events', True)
else:
@@ -51430,7 +51432,6 @@ def printShowCalendarEvents(users):
Ind.Decrement()
if csvPF:
if calendarEventEntity['countsOnly'] and calendarEventEntity['eventRowFilter']:
csvPF.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
csvPF.SetTitles(calendarEventEntity['countsOnlyTitles'])
csvPF.writeCSVfile('Calendar Events', True)
else:
@@ -56210,6 +56211,7 @@ def printFileList(users):
summaryMimeTypeInfo[mimeType]['size'] += mtinfo['size']
if summary != FILECOUNT_SUMMARY_ONLY:
writeMimeTypeCountsRow(user, 'Various', 'Various', mimeTypeInfo)
titlePrefix = f'{Cmd.Argument(GM.Globals[GM.ENTITY_CL_START])} {Cmd.Argument(GM.Globals[GM.ENTITY_CL_START]+1)} ' if GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE] is None else ''
if not countsOnly:
if not csvPF.rows:
setSysExitRC(NO_ENTITIES_FOUND_RC)
@@ -56218,22 +56220,14 @@ def printFileList(users):
else:
if 'JSON' in csvPF.JSONtitlesList:
csvPF.MoveJSONTitlesToEnd(['JSON'])
if GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE] is None:
csvPF.writeCSVfile(f'{Cmd.Argument(GM.Globals[GM.ENTITY_CL_START])} {Cmd.Argument(GM.Globals[GM.ENTITY_CL_START]+1)} Drive Files')
else:
csvPF.writeCSVfile('Drive Files')
csvPF.writeCSVfile(f'{titlePrefix}Drive Files')
else:
if not csvPFco.rows:
setSysExitRC(NO_ENTITIES_FOUND_RC)
if summary != FILECOUNT_SUMMARY_NONE:
writeMimeTypeCountsRow(summaryUser, 'Various', 'Various', summaryMimeTypeInfo)
csvPFco.todrive = csvPF.todrive
if not countsRowFilter:
csvPFco.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
if GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE] is None:
csvPFco.writeCSVfile(f'{Cmd.Argument(GM.Globals[GM.ENTITY_CL_START])} {Cmd.Argument(GM.Globals[GM.ENTITY_CL_START]+1)} Drive File Counts', not countsRowFilter)
else:
csvPFco.writeCSVfile('Drive File Counts', not countsRowFilter)
csvPFco.writeCSVfile(f'{titlePrefix}Drive File Counts', not countsRowFilter)
FILECOMMENTS_FIELDS_CHOICE_MAP = {
'action': 'action',

View File

@@ -633,6 +633,8 @@ gam calendar <CalendarEntity> deleteevent (id|eventid <EventID>)+ [doit] [<Event
gam calendar <CalendarEntity> moveevent (id|eventid <EventID>)+ destination <CalendarItem> [<EventNotificationAttribute>]
gam calendar <CalendarEntity> updateevent <EventID> <EventAttribute>+ [<EventNotificationAttribute>]
gam calendar <CalendarEntity> wipe
gam calendar <CalendarEntity> printevents <EventSelectProperty>* <EventDisplayProperty>* [fields <EventFieldNameList>]
[formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
gam calendar <CalendarEntity> printevents <EventSelectProperty>* <EventDisplayProperty>*
[fields <EventFieldNameList>]
[countsonly [eventrowfilter]]
[formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
```

View File

@@ -10,6 +10,14 @@ 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.07.08
Fixed bug in `gam <UserTypeEntity> print filelist ... countsonly` that issued an
incorrect warning message like the following when `redirect csv <FileName> multiprocess` was specified.
```
WARNING: csv_output_row_filter column "^name$" does not match any output columns
```
### 7.07.07
Fixed bug in `gam report <ActivityApplictionName> ... countsonly eventrowfilter` that issued an

View File

@@ -251,10 +251,10 @@ 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.07.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.07.08 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.4.1 x86_64
MacOS Sequoia 15.5 x86_64
Path: /Users/admin/bin/gam7
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
@@ -989,7 +989,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
GAM 7.07.07 - https://github.com/GAM-team/GAM - pythonsource
GAM 7.07.08 - https://github.com/GAM-team/GAM - pythonsource
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
Windows-10-10.0.17134 AMD64

View File

@@ -3,10 +3,10 @@
Print the current version of Gam with details
```
gam version
GAM 7.07.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.07.08 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.4.1 x86_64
MacOS Sequoia 15.5 x86_64
Path: /Users/Admin/bin/gam7
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Time: 2023-06-02T21:10:00-07:00
@@ -15,10 +15,10 @@ 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.07.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.07.08 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.4.1 x86_64
MacOS Sequoia 15.5 x86_64
Path: /Users/Admin/bin/gam7
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Your system time differs from www.googleapis.com by less than 1 second
@@ -27,10 +27,10 @@ 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.07.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.07.08 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.4.1 x86_64
MacOS Sequoia 15.5 x86_64
Path: /Users/Admin/bin/gam7
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Time: 2023-06-02T21:10:00-07:00
@@ -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.07.07
Latest: 7.07.08
echo $?
1
```
@@ -72,7 +72,7 @@ echo $?
Print the current version number without details
```
gam version simple
7.07.07
7.07.08
```
In Linux/MacOS you can do:
```
@@ -82,10 +82,10 @@ echo $VER
Print the current version of Gam and address of this Wiki
```
gam help
GAM 7.07.07 - https://github.com/GAM-team/GAM
GAM 7.07.08 - https://github.com/GAM-team/GAM
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.4.1 x86_64
MacOS Sequoia 15.5 x86_64
Path: /Users/Admin/bin/gam7
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Time: 2023-06-02T21:10:00-07:00