else: print 'Team fetch succeeded' print 'Now trying to edit team ', team_name res = sdclient.edit_team(team_name, description='Nextgen2', users=['*****@*****.**', '*****@*****.**']) if res[0] == False: print 'Could not edit team ', res[1] else: print 'Edited team to change description and add users' print 'Now trying to edit user ', user_name res = sdclient.edit_user(user_name, firstName='Just', lastName='Edited3', teams=[team_name], roles=['ROLE_CUSTOMER', 'ROLE_USER']) if res[0] == False: print 'Could not edit user: '******'Edit user succeeded' print 'Now trying to delete the team ', team_name res = sdclient.delete_team(team_name) if res[0] == False: print 'Could not delete team: ', res[1] else: print 'Delete team succeeded' sys.exit(0)
memberships = { '*****@*****.**': 'ROLE_TEAM_MANAGER', '*****@*****.**': 'ROLE_TEAM_READ' } ok, res = sdclient.edit_team(team_name, description='Nextgen2', memberships=memberships) if not ok: print('Could not edit team:', res, '. Exiting.') sys.exit(1) else: print('Edited team to change description and add users') print('Now trying to edit user:'******'Just', lastName='Edited3', systemRole='ROLE_CUSTOMER') if not ok: print('Could not edit user:'******'. Exiting.') sys.exit(1) else: print('Edit user succeeded') print('Now trying to delete the team:', team_name) ok, res = sdclient.delete_team(team_name) if not ok: print('Could not delete team:', res, '. Exiting.') sys.exit(1) else: print('Delete team succeeded')