Prints project names to stdout for all projects or just those with the specified auth_role
        :param filter_auth_role: str: optional auth_role to filter project list
355400
def print_project_list_details(self, filter_auth_role, long_format):
        
        if filter_auth_role:
            projects_details = self.remote_store.get_projects_with_auth_role(auth_role=filter_auth_role)
        else:
            projects_details = self.remote_store.get_projects_details()
        if projects_details:
            for projects_detail in projects_details:
                print(self.get_project_info_line(projects_detail, long_format))
        else:
            print(NO_PROJECTS_FOUND_MESSAGE)
161494
def register_list_auth_roles_command(self, list_auth_roles_func):
        
        description = "List authorization roles for use with add_user command."
        list_auth_roles_parser = self.subparsers.add_parser('list-auth-roles', description=description)
        list_auth_roles_parser.set_defaults(func=list_auth_roles_func)
1027179
def print_logs(query, types=None):
    
    if query is None:
        return

    for run, log in query:
        print(("{0} @ {1} - {2} id: {3} group: {4} status: {5}".format(
            run.end, run.experiment_name, run.project_name,
            run.experiment_group, run.run_group, log.status)))
        print(("command: {0}".format(run.command)))
        if "stderr" in types:
            print("StdErr:")
            print((log.stderr))
        if "stdout" in types:
            print("StdOut:")
            print((log.stdout))
        print()
163175
def role_list(profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    ret = {}
    for role in kstone.roles.list():
        ret[role.name] = dict((value, getattr(role, value)) for value in dir(role)
                              if not value.startswith('_') and
                              isinstance(getattr(role, value), (six.string_types, dict, bool)))
    return ret
978707
def list_role_policies(role_name, region=None, key=None, keyid=None,
                       profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        response = conn.list_role_policies(role_name)
        _list = response.list_role_policies_response.list_role_policies_result
        return _list.policy_names
    except boto.exception.BotoServerError as e:
        log.debug(e)
        return []
580177
def list_roles(self):
    
        '''
            
        '''

        title = '%s.list_certificates' % self.__class__.__name__

    # send request for list of certificates
        self.printer('Querying AWS for iam roles.')
        try:
            response = self.connection.list_roles()
        except:
            raise AWSConnectionError(title)

    # construct certificate list from response
        role_list = []
        if 'Roles' in response.keys():
            for role in response['Roles']:
                role_list.append(role['RoleName'])

    # report results and return list
        if role_list:
            print_out = 'Found iam roles'
            if len(role_list) > 1:
                print_out += 's'
            from labpack.parsing.grammar import join_words
            print_out += ' %s.' % join_words(role_list)
            self.printer(print_out)
        else:
            self.printer('No iam roles found.')

        self.role_list = role_list
        
        return self.role_list
649443
def add_accounts_to_project(accounts_query, project):
    

    query = accounts_query.filter(date_deleted__isnull=True)

    for account in query:
        add_account_to_project(account, project)
1195240
def projects(accountable):
    
    projects = accountable.metadata()['projects']
    headers = sorted(['id', 'key', 'self'])
    rows = [[v for k, v in sorted(p.items()) if k in headers] for p in projects]
    rows.insert(0, headers)
    print_table(SingleTable(rows))
804501
def get_instances_in_role(self, role, state_filter=None):
    
    self._check_role_name(role)
    instances = []
    
    for instance in self._get_instances(self._group_name_for_role(role), 
                                       state_filter):            
      instances.append(Instance(instance.id, instance.dns_name, 
                                instance.private_dns_name, 
                                instance.private_ip_address))
      
    return instances
250272
public List<GitlabTrigger> getPipelineTriggers(GitlabProject project) {
        if (!project.isJobsEnabled()) {
            // if the project has not allowed jobs, you will only get a 403 forbidden message which is
            // not helpful.
            throw new IllegalStateException("Jobs are not enabled for " + project.getNameWithNamespace());
        } else {
            return retrieve().getAll(GitlabProject.URL + "/" + project.getId() + GitlabTrigger.URL + PARAM_MAX_ITEMS_PER_PAGE, GitlabTrigger[].class);
        }
    }
891845
def logging_list_filters(**kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('logging:list_filters', **{
        'logging_service': ctx.repo.create_secure_service('logging'),
    })
498110
def get_project_actors_for_role_project(self, project_key, role_id):
        
        url = 'rest/api/2/project/{projectIdOrKey}/role/{id}'.format(projectIdOrKey=project_key,
                                                                     id=role_id)
        return (self.get(url) or {}).get('actors')
769023
def delete_user_role(self, user, role):
        
        self.project_service.set_auth(self._token_project)
        self.project_service.delete_user_role(user, role)
436314
def print_status(self, roles=None, state_filter="running"):
    
    if not roles:
      for instance in self._get_instances(self._get_cluster_group_name(),
                                          state_filter):
        self._print_instance("", instance)
    else:
      for role in roles:
        for instance in self._get_instances(self._group_name_for_role(role),
                                            state_filter):
          self._print_instance(role, instance)
1287536
def get_users_in_project(self, projectname):
        
        cmd = ["list", "assoc", "where", "account=%s" % projectname]
        results = self._read_output(cmd)

        user_list = []
        for result in results:
            if result["User"] != "":
                user_list.append(result["User"])
        return user_list
1021950
def contentsMethod(self, contentFilter):
        
        allowedroles = ['Manager', 'LabManager', 'Client', 'LabClerk']
        pm = getToolByName(self.context, "portal_membership")
        member = pm.getAuthenticatedMember()
        roles = member.getRoles()
        allowed = [a for a in allowedroles if a in roles]
        return self.context.objectValues('ARReport') if allowed else []
238311
def _get_users_from_project(self, project_id, roles, project_users):
        

        # For keystone.user_list project_id is not passed as argument because
        # it is ignored when using admin credentials
        # Get all users (to be able to find user name)
        users = api.keystone.user_list(self.request)
        users = {user.id: user for user in users}

        # Get project_users_roles ({user_id: [role_id_1, role_id_2]})
        project_users_roles = api.keystone.get_project_users_roles(
            self.request,
            project=project_id)

        for user_id in project_users_roles:

            if user_id not in project_users:
                # Add user to the project_users
                project_users[user_id] = users[user_id]
                project_users[user_id].roles = []
                project_users[user_id].roles_from_groups = []

            # Update the project_user role in order to get:
            # project_users[user_id].roles = [role_name1, role_name2]
            self._update_user_roles_names_from_roles_id(
                user=project_users[user_id],
                users_roles=project_users_roles[user_id],
                roles_list=roles
            )