Role conflict when importing nova auth

Bug #969088 reported by Mark McLoughlin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Undecided
Mark McLoughlin
Essex
Fix Released
Undecided
Unassigned
keystone (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
Undecided
Unassigned

Bug Description

To migrate from Nova's deprecated auth to keystone, I did:

 $> sudo ADMIN_PASSWORD=$OS_PASSWORD SERVICE_PASSWORD=servicepass openstack-keystone-sample-data
 $> sudo nova-manage export auth > auth-export.json
 $> sudo keystone-manage import_nova_auth auth-export.json
   File "/usr/lib/python2.7/site-packages/keystone/identity/backends/sql.py", line 48, in wrapper
     raise exception.Conflict(type=type, details=str(e))
 keystone.exception.Conflict: Conflict occurred attempting to store role. (IntegrityError) (1062, "Duplicate entry 'sysadmin' for key 'name\
 '") 'INSERT INTO role (id, name) VALUES (%s, %s)' ('b8a2ed868ea2440291f612d2bae252e6', 'sysadmin')

This sample data script is included in the Fedora packages and based on devstack's similar script. Perhaps it shouldn't be adding the sysadmin role. Perhaps the script is just a bad idea. Whatever.

It seems to me, though, that there's no particular need for import_nova_auth to barf if a role already exists. If the role exists, we can happily use it and there's no worry that the existing role doesn't match the desired role since a role is just a name.

Proposing a patch to make import_nova_auth only create roles if they don't already exist.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/5993

Changed in keystone:
assignee: nobody → Mark McLoughlin (markmc)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/5993
Committed: http://github.com/openstack/keystone/commit/875a67aa69e17d49e2cca40857b76b46dc639657
Submitter: Jenkins
Branch: master

commit 875a67aa69e17d49e2cca40857b76b46dc639657
Author: Mark McLoughlin <email address hidden>
Date: Fri Mar 30 12:17:48 2012 +0100

    Make import_nova_auth only create roles which don't already exist

    Fixes bug #969088

    If a role already exists, there's no particular need for import_nova_auth
    to barf. Instead, we should just use the existing role.

    Change-Id: I18ae38af62b4c2b2423e20e436611fc30f844ae1

Changed in keystone:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (stable/essex)

Fix proposed to branch: stable/essex
Review: https://review.openstack.org/7385

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (stable/essex)

Reviewed: https://review.openstack.org/7385
Committed: http://github.com/openstack/keystone/commit/aff45d69a73033241531f5e3542a8d1782ddd859
Submitter: Jenkins
Branch: stable/essex

commit aff45d69a73033241531f5e3542a8d1782ddd859
Author: Mark McLoughlin <email address hidden>
Date: Fri Mar 30 12:17:48 2012 +0100

    Make import_nova_auth only create roles which don't already exist

    Fixes bug #969088

    If a role already exists, there's no particular need for import_nova_auth
    to barf. Instead, we should just use the existing role.

    Change-Id: I18ae38af62b4c2b2423e20e436611fc30f844ae1

tags: added: in-stable-essex
Joseph Heck (heckj)
Changed in keystone:
milestone: none → folsom-1
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Chuck Short (zulcss)
Changed in keystone (Ubuntu):
status: New → In Progress
Changed in keystone (Ubuntu Precise):
status: New → In Progress
Thierry Carrez (ttx)
Changed in keystone:
milestone: folsom-1 → 2012.2
Revision history for this message
Chuck Short (zulcss) wrote :

Should already be in the cloud archive.

Changed in keystone (Ubuntu):
status: In Progress → Fix Released
Changed in keystone (Ubuntu Precise):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.