commit b84e22be601f9f6fc48a9e10a3fb508c576b1d93
Author: Matthew Treinish <email address hidden>
Date: Fri Feb 6 13:52:00 2015 -0500
Fix race on default role creation
In add_user_to_project() it checks if the default role exists before
trying to add the role to the user and project. If it doesn't exist it
will attempt to create the role. However if 2 requests happen at
roughly the same time the 2 role creations will race causing one to
fail with a conflict error. This patch addresses this issue by catching
the conflict exception and treating it as the create succeeded (which it
did just elsewhere)
Conflicts:
keystone/assignment/core.py
Change-Id: Iab95ed8b3913c020eafa919231d764ba8b780571
Closes-Bug: #1419043
(cherry picked from commit 0b1027886ae6bc29abd86aa8ede499be5f5fc2ae)
Reviewed: https:/ /review. openstack. org/153713 /git.openstack. org/cgit/ openstack/ keystone/ commit/ ?id=b84e22be601 f9f6fc48a9e10a3 fb508c576b1d93
Committed: https:/
Submitter: Jenkins
Branch: stable/juno
commit b84e22be601f9f6 fc48a9e10a3fb50 8c576b1d93
Author: Matthew Treinish <email address hidden>
Date: Fri Feb 6 13:52:00 2015 -0500
Fix race on default role creation
In add_user_ to_project( ) it checks if the default role exists before
trying to add the role to the user and project. If it doesn't exist it
will attempt to create the role. However if 2 requests happen at
roughly the same time the 2 role creations will race causing one to
fail with a conflict error. This patch addresses this issue by catching
the conflict exception and treating it as the create succeeded (which it
did just elsewhere)
Conflicts: assignment/ core.py
keystone/
Change-Id: Iab95ed8b3913c0 20eafa919231d76 4ba8b780571 9abd86aa8ede499 be5f5fc2ae)
Closes-Bug: #1419043
(cherry picked from commit 0b1027886ae6bc2