mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-09 22:23:35 +00:00
Handle Google mis-reporting invalid group in gam print groups settings (#342)
This commit is contained in:
@ -9198,11 +9198,11 @@ def doPrintGroups():
|
|||||||
group[u'Owners'] = memberDelimiter.join(allOwners)
|
group[u'Owners'] = memberDelimiter.join(allOwners)
|
||||||
if getSettings and not GroupIsAbuseOrPostmaster(groupEmail):
|
if getSettings and not GroupIsAbuseOrPostmaster(groupEmail):
|
||||||
sys.stderr.write(u" Retrieving Settings for group %s (%s/%s)...\r\n" % (groupEmail, i, count))
|
sys.stderr.write(u" Retrieving Settings for group %s (%s/%s)...\r\n" % (groupEmail, i, count))
|
||||||
try:
|
|
||||||
settings = callGAPI(gs.groups(), u'get',
|
settings = callGAPI(gs.groups(), u'get',
|
||||||
retry_reasons=[u'serviceLimit'],
|
soft_errors=True,
|
||||||
throw_reasons=[u'invalid'],
|
retry_reasons=[u'serviceLimit', u'invalid'],
|
||||||
groupUniqueId=groupEmail, fields=gsfields)
|
groupUniqueId=groupEmail, fields=gsfields)
|
||||||
|
if settings:
|
||||||
for key in settings:
|
for key in settings:
|
||||||
if key in [u'email', u'name', u'description', u'kind', u'etag']:
|
if key in [u'email', u'name', u'description', u'kind', u'etag']:
|
||||||
continue
|
continue
|
||||||
@ -9212,7 +9212,7 @@ def doPrintGroups():
|
|||||||
if key not in titles:
|
if key not in titles:
|
||||||
addTitleToCSVfile(key, titles)
|
addTitleToCSVfile(key, titles)
|
||||||
group[key] = setting_value
|
group[key] = setting_value
|
||||||
except googleapiclient.errors.HttpError:
|
else:
|
||||||
sys.stderr.write(u" Settings unavailable for group %s (%s/%s)...\r\n" % (groupEmail, i, count))
|
sys.stderr.write(u" Settings unavailable for group %s (%s/%s)...\r\n" % (groupEmail, i, count))
|
||||||
csvRows.append(group)
|
csvRows.append(group)
|
||||||
writeCSVfile(csvRows, titles, u'Groups', todrive)
|
writeCSVfile(csvRows, titles, u'Groups', todrive)
|
||||||
|
Reference in New Issue
Block a user