different behavior when deleting with request body (no BadRequest with core resources in case of pecan)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Won't Fix
|
Medium
|
Yushiro FURUKAWA |
Bug Description
In master environment, it is different behavior when we try to delete with
request body. I fixed it in [1] but CORE_RESOURCE(
[1] https:/
[FloatingIP, Router]
$ source ~/devstack/openrc admin admin; export TOKEN=`openstack token issue | grep ' id ' | get_field 2`
$ curl -i -X DELETE -d '{"floatingip"
HTTP/1.1 400 Bad Request
Content-Length: 113
Content-Type: application/json
X-Openstack-
Date: Fri, 30 Jun 2017 00:56:56 GMT
{"NeutronError": {"message": "Request body is not supported in DELETE.", "type": "HTTPBadRequest", "detail": ""}}
$ curl -i -X DELETE -d '{"router": {"name": "aaa"}}' -H "content-
HTTP/1.1 400 Bad Request
Content-Length: 113
Content-Type: application/json
X-Openstack-
Date: Fri, 30 Jun 2017 01:44:40 GMT
{"NeutronError": {"message": "Request body is not supported in DELETE.", "type": "HTTPBadRequest", "detail": ""}}
[Core resources: Network/
$ source ~/devstack/openrc admin admin; export TOKEN=`openstack token issue | grep ' id ' | get_field 2`
$ curl -i -X DELETE -d '{"network"
HTTP/1.1 204 No Content
Content-Length: 0
X-Openstack-
Date: Fri, 30 Jun 2017 01:32:12 GMT
$ curl -i -X DELETE -d '{"subnet": {"name": "aaa"}}' -H "content-
HTTP/1.1 204 No Content
Content-Length: 0
X-Openstack-
Date: Fri, 30 Jun 2017 01:37:01 GMT
$ curl -i -X DELETE -d '{"port": {"name": "aaa"}}' -H "content-
HTTP/1.1 204 No Content
Content-Length: 0
X-Openstack-
Date: Fri, 30 Jun 2017 01:37:33 GMT
$ curl -i -X DELETE -d '{"subnetpool": {"description": "aaa"}}' -H "content-
HTTP/1.1 204 No Content
Content-Length: 0
X-Openstack-
Date: Fri, 30 Jun 2017 06:24:58 GMT
Changed in neutron: | |
assignee: | nobody → Yushiro FURUKAWA (y-furukawa-2) |
tags: | added: api |
description: | updated |
Changed in neutron: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
summary: |
- different behavior when deleting with request body + different behavior when deleting with request body (no BadRequest with + core resources) |
summary: |
different behavior when deleting with request body (no BadRequest with - core resources) + core resources in case of pecan) |
description: | updated |
I added following patch and tried to delete network resource. As a result, I recorded trace for method calling. Please refer attached file:
[diff --no-prefix] db/db_base_ plugin_ v2.py neutron/ db/db_base_ plugin_ v2.py db/db_base_ plugin_ v2.py db/db_base_ plugin_ v2.py
diff --git neutron/
index aad5461..60525c1 100644
--- neutron/
+++ neutron/
@@ -13,6 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+import inspect
+
import functools
import netaddr V2(db_base_ plugin_ common. DbBasePluginCom mon,
@@ -427,6 +429,23 @@ class NeutronDbPlugin
@db_ api.retry_ if_session_ inactive( ) network( self, context, id): :"f_lineno" , inspect. currentframe( ) ======= =====" frame_attr_ dict.iteritems( )): frame_object, attr_name), "#",attr_discript
registry. notify( resources. NETWORK, events. BEFORE_ DELETE, self,
context= context, network_id=id)
self. _ensure_ network_ not_in_ use(context, id)
def delete_
+
+ frame_attr_dict = {
+ "f_back": "f_back",
+ "f_code": "f_code",
+ "f_lineno"
+ }
+ frame_object=
+ while frame_object != None :
+ print "======
+ code_object = frame_object.f_code
+ print code_object.co_name
+ for attr_name, attr_discript in sorted(
+ print attr_name, "=", getattr(
+ frame_object = frame_object.f_back
+