create_server fails if server is not unique

Bug #1290560 reported by Richard Megginson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Fix Released
Undecided
Richard Megginson
Icehouse
Fix Released
Undecided
Richard Megginson

Bug Description

Many of the tests e.g. test_api/test_v1/test_domains.py call create_server() to make sure the server is there, expecting that a duplicate server will be ignored. However, in my tests, all of these calls to create_server() throw an uncaught exception "IntegrityError: UNIQUE constraint failed: servers.name ...."

looks like the code in sqlalchemy/models.py catches some cases of IntegrityError and inspects the message string to see if it should throw an exceptions.Duplicate, but this error message is not one of those.

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

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

Changed in designate:
assignee: nobody → Richard Megginson (rmeggins)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (master)

Reviewed: https://review.openstack.org/79455
Committed: https://git.openstack.org/cgit/stackforge/designate/commit/?id=3ec268356fc44847f7c85f8a0d2a5faf7c8fc822
Submitter: Jenkins
Branch: master

commit 3ec268356fc44847f7c85f8a0d2a5faf7c8fc822
Author: Rich Megginson <email address hidden>
Date: Mon Mar 10 15:09:43 2014 -0600

    create_server fails if server is not unique

    The error message for the exception is:
    (IntegrityError) UNIQUE constrait failed: table.column ....
    The fix is to add the string "unique constraint failed" when looking
    for IntegrityErrors to convert to exceptions.Duplicates.
    Closes-Bug: 1290560
    Change-Id: Id8e28443cf238a888e780f38f983129e5ac1d2f0

Changed in designate:
status: In Progress → Fix Committed
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.