Soft errors on team drive functions

This commit is contained in:
Jay Lee
2017-03-22 13:59:38 -04:00
parent 67f5416858
commit ad9384aeac

View File

@ -6757,8 +6757,12 @@ def doUpdateTeamDrive(users):
print body print body
sys.exit(4) sys.exit(4)
for user in users: for user in users:
drive = buildGAPIServiceObject(u'drive3', user) user, drive = buildDrive3GAPIObject(user)
result = callGAPI(drive.teamdrives(), u'update', body=body, teamDriveId=teamDriveId, fields=u'') if not drive:
continue
result = callGAPI(drive.teamdrives(), u'update', body=body, teamDriveId=teamDriveId, fields=u'', soft_errors=True)
if not result:
continue
print u'Updated Team Drive %s' % (teamDriveId) print u'Updated Team Drive %s' % (teamDriveId)
def printShowTeamDrives(users, csvFormat): def printShowTeamDrives(users, csvFormat):
@ -6777,7 +6781,7 @@ def printShowTeamDrives(users, csvFormat):
user, drive = buildDrive3GAPIObject(user) user, drive = buildDrive3GAPIObject(user)
if not drive: if not drive:
continue continue
results = callGAPIpages(drive.teamdrives(), u'list', items=u'teamDrives', fields=u'*') results = callGAPIpages(drive.teamdrives(), u'list', items=u'teamDrives', fields=u'*', soft_errors=True)
if not results: if not results:
continue continue
for td in results: for td in results:
@ -6800,8 +6804,10 @@ def doDeleteTeamDrive(users):
teamDriveId = sys.argv[5] teamDriveId = sys.argv[5]
for user in users: for user in users:
user, drive = buildDrive3GAPIObject(user) user, drive = buildDrive3GAPIObject(user)
callGAPI(drive.teamdrives(), u'delete', teamDriveId=teamDriveId) if not drive:
print u'Deleted Team Drive %s' % (teamDriveId) continue
print u'Deleting Team Drive %s' % (teamDriveId)
callGAPI(drive.teamdrives(), u'delete', teamDriveId=teamDriveId, soft_errors=True)
def doCreateUser(): def doCreateUser():
cd = buildGAPIObject(u'directory') cd = buildGAPIObject(u'directory')