]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Make SubnetMismatchForPort extend BadRequest rather than Conflict
authorMatt Riedemann <mriedem@us.ibm.com>
Thu, 8 Aug 2013 19:33:10 +0000 (12:33 -0700)
committerMark McClain <mark.mcclain@dreamhost.com>
Fri, 9 Aug 2013 03:10:41 +0000 (23:10 -0400)
commit6cd3e190c6ef6f5df9b1b101bd45102e44ca8588
treed9c8390c324a563f13e3965176947cac27930a0c
parentfd1c78a81582b0e6d56af070c8d978fd53e3b15b
Make SubnetMismatchForPort extend BadRequest rather than Conflict

Nova is trying to do a better job of mapping Neutron exceptions and
change I4c087684ef77988e5f463d7f2f50fc2a04f37db0 is trying to map 409 to
the proper nova exception. In looking at what raises a 409 exception in
Neutron, the SubnetMismatchForPort exception seemed like a candidate for
changing from Conflict (409) to BadRequest (400) to ease that mapping.

Note that the only thing currently using this exception is the L3 router
extension when removing a router interface and the 400 response code is
already listed in the API docs as a possible response code:

http://docs.openstack.org/api/openstack-network/2.0/content/router_remove_interface.html

Also note that it's generally OK to change APIs for a more accurate
response code:

https://wiki.openstack.org/wiki/APIChangeGuidelines#Generally_Considered_OK

Related-Bug: #1209446

Change-Id: I4507e1db69d738ec0f943f1b8b1209f269d5aebf
neutron/common/exceptions.py
neutron/tests/unit/bigswitch/test_router_db.py
neutron/tests/unit/nicira/test_nicira_plugin.py
neutron/tests/unit/test_l3_plugin.py