def add_team_member(name, team_name, profile='github'):
 team = get_team(team_name, profile=profile)
 if (not team):
  log.error('Team {0} does not exist'.format(team_name))
  return False
 try:
  client = _get_client(profile)
  organization = client.get_organization(_get_config_value(profile, 'org_name'))
  team = organization.get_team(team['id'])
  member = client.get_user(name)
 except UnknownObjectException as e:
  log.exception('Resource not found: {0}'.format(team['id']))
  return False
 try:
  (headers, data) = team._requester.requestJsonAndCheck('PUT', ((team.url + '/memberships/') + member._identity), input={'role': 'member'}, parameters={'role': 'member'})
 except github.GithubException as e:
  log.exception('Error in adding a member to a team: {0}'.format(str(e)))
  return False
 return True

def add_team_member ( name , team_name , profile = 'github' ) : team = get_team ( team_name , profile = profile ) if ( not team ) : log . error ( 'Team {0} does not exist' . format ( team_name ) ) return False try : client = _get_client ( profile ) organization = client . get_organization ( _get_config_value ( profile , 'org_name' ) ) team = organization . get_team ( team [ 'id' ] ) member = client . get_user ( name ) except UnknownObjectException as e : log . exception ( 'Resource not found: {0}' . format ( team [ 'id' ] ) ) return False try : ( headers , data ) = team . _requester . requestJsonAndCheck ( 'PUT' , ( ( team . url + '/memberships/' ) + member . _identity ) , input = { 'role' : 'member' } , parameters = { 'role' : 'member' } ) except github . GithubException as e : log . exception ( 'Error in adding a member to a team: {0}' . format ( str ( e ) ) ) return False return True
adds a team member to a team with team_name .