Comment 2 for bug 1700852

Revision history for this message
Steve McLellan (sjmc7) wrote :

Looks like the slow code here is strip_domain_roles:

    def _strip_domain_roles(self, role_refs):
        """Post process assignment list for domain roles.

        Domain roles are only designed to do the job of inferring other roles
        and since that has been done before this method is called, we need to
        remove any assignments that include a domain role.

        """
        def _role_is_global(role_id):
            ref = self.role_api.get_role(role_id)
            return (ref['domain_id'] is None)

        filter_results = []
        for ref in role_refs:
            if _role_is_global(ref['role_id']):
                filter_results.append(ref)
        return filter_results

With caching the time would probably go away, but as it is, it's making a DB lookup for each role.