Handle Google reporting invalid when getting group settings (#335)

This commit is contained in:
Ross Scroggs
2016-11-16 09:45:04 -08:00
committed by Jay Lee
parent 8a6ce43ad3
commit e777eb6c99

View File

@ -9189,8 +9189,10 @@ 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'], retry_reasons=[u'serviceLimit'],
throw_reasons=[u'invalid'],
groupUniqueId=groupEmail, fields=gsfields) groupUniqueId=groupEmail, fields=gsfields)
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']:
@ -9201,6 +9203,8 @@ 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:
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)