]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Make NeutronDbObjectDuplicateEntry exception more verbose
authorMiguel Angel Ajo <mangelajo@redhat.com>
Wed, 19 Aug 2015 13:15:21 +0000 (15:15 +0200)
committerMiguel Angel Ajo <mangelajo@redhat.com>
Mon, 24 Aug 2015 10:00:38 +0000 (12:00 +0200)
commitdf31ac1f11b8139d8b930d05565003ba74150e82
tree151002343502cde045002ae1b5b744055b606db6
parent01c0466d74a4c1e50d53f9215b95aa3db62760c9
Make NeutronDbObjectDuplicateEntry exception more verbose

NeutronObjectDuplicateEntry is an exception derived from Conflict,
which is mapped to HTTPConflict. When such exception is thrown
during an API layer call, we will provide more detail to the caller
about what was exactly duplicated, and for which fields,
the information is extracted from the DB exception.

NeutronObjectDuplicateEntry is renamed into NeutronDbObjectDuplicate
to make clear it is for handling db duplicate exceptions, in
the future we could generalize to a base NeutronObjectDuplicate class
if we need separate handling for other object backings (mem, keystore,
etc).

Change-Id: I6ec5883b3456ebc842f3f7bffd8cc924293f5766
neutron/objects/base.py
neutron/tests/unit/objects/test_base.py