← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1186128] Re: Migration 020 incorrectly assigns roles.

 

** Changed in: keystone/grizzly
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1186128

Title:
  Migration 020 incorrectly assigns roles.

Status in OpenStack Identity (Keystone):
  Fix Committed
Status in Keystone grizzly series:
  Fix Released

Bug description:
  This is showing up intermitantly in MySQL tests with SQL upgrades. A
  query in migration 020 is incorrectly formed and results in updating
  all of a user's roles rather than just that assigned to a project.

  On the current master: 
  https://github.com/openstack/keystone/blob/50be064b9243182799ce6544d169f414594d628b/keystone/common/sql/migrate_repo/versions/020_migrate_metadata_table_roles.py#L44

  the query:

      q = new_metadata_table.update().where(
              new_metadata_table.c.user_id == metadata.user_id and
              new_metadata_table.c.project_id == metadata.tenant_id).values(
                  data=json.dumps(data))

  produces the statement:

      UPDATE user_project_metadata SET data=%s WHERE
  user_project_metadata.user_id = %s

  rather than the obviously intended:

      UPDATE user_project_metadata SET data=%s WHERE
  user_project_metadata.user_id = %s AND
  user_project_metadata.project_id = %s

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