← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1224114] Re: UpdateProjectMembersAction is polling all users.

 

** Changed in: horizon
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1224114

Title:
  UpdateProjectMembersAction is polling all users.

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  The Update Project Members Action is polling all users for their roles
  when it only needs the current tenant's users roles.

  Line: 218 openstack_dashboard/dashboards/admin/projects/workflows.py

          # Figure out users & roles
          if project_id:
              for user in all_users:
                  try:
                      roles = api.keystone.roles_for_user(self.request,
                                                          user.id,
                                                          project_id)
                  except Exception:
                      exceptions.handle(request,
                                        err_msg,
                                        redirect=reverse(INDEX_URL))
                  for role in roles:
                      field_name = self.get_member_field_name(role.id)
                      self.fields[field_name].initial.append(user.id)

  If there are more than a few users this quickly turns into a horrible
  slowdown as hundreds or thousands (depending on user count) of calls
  have to be made to keystone for each users roles.

  We could easily replace all_users with project_members like so...

   # Figure out users & roles
          if project_id:
              project_members = api.keystone.user_list(request,
                  project=project_id)
              for user in project_members:
                  ETC...

  I'll propose this change for review.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1224114/+subscriptions