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.
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.
""" global( role_id) : api.get_ role(role_ id)
def _role_is_
ref = self.role_
return (ref['domain_id'] is None)
for ref in role_refs:
if _role_is_
return filter_results
With caching the time would probably go away, but as it is, it's making a DB lookup for each role.