the response code of add_host and remove_host in nova v3 aggreate api is error

Bug #1214315 reported by Ivan-Zhu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Alex Xu

Bug Description

 when I port the test_aggregates, I find the response code of add_host and remove_host in nova v3 aggregates api is wrong. I find their response code is 200, but there are decorate @wsgi.response(202) for these api. so I guess maybe there is a bug in this decorate.

the tempest log is following:
2013-08-20 17:32:45.438 27610 INFO tempest.common.rest_client [-] Request: POST http://192.168.1.101:8774/v3/os-aggregates
2013-08-20 17:32:45.438 27610 DEBUG tempest.common.rest_client [-] Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<Token omitted>'} _log_request /opt/stack/tempest/tempest/common/rest_client.py:295
2013-08-20 17:32:45.439 27610 DEBUG tempest.common.rest_client [-] Request Body: {"aggregate": {"name": "test_aggregate_1028841100", "availability_zone": null}} _log_request /opt/stack/tempest/tempest/common/rest_client.py:299
2013-08-20 17:32:45.533 27610 INFO tempest.common.rest_client [-] Response Status: 201
2013-08-20 17:32:45.533 27610 DEBUG tempest.common.rest_client [-] Response Headers: {'date': 'Tue, 20 Aug 2013 09:32:45 GMT', 'content-length': '187', 'content-type': 'application/json', 'x-compute-request-id': 'req-8cb24fc8-b5ff-4e59-869d-4ef1ed146a36'} _log_response /opt/stack/tempest/tempest/common/rest_client.py:310
2013-08-20 17:32:45.533 27610 DEBUG tempest.common.rest_client [-] Response Body: {"aggregate": {"name": "test_aggregate_1028841100", "availability_zone": null, "deleted": 0, "created_at": "2013-08-20T09:32:45.000000", "updated_at": null, "deleted_at": null, "id": 27}} _log_response /opt/stack/tempest/tempest/common/rest_client.py:314
2013-08-20 17:32:45.533 27610 INFO tempest.common.rest_client [-] Request: POST http://192.168.1.101:8774/v3/os-aggregates/27/action
2013-08-20 17:32:45.534 27610 DEBUG tempest.common.rest_client [-] Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<Token omitted>'} _log_request /opt/stack/tempest/tempest/common/rest_client.py:295
2013-08-20 17:32:45.534 27610 DEBUG tempest.common.rest_client [-] Request Body: {"add_host": {"host": "zhubo"}} _log_request /opt/stack/tempest/tempest/common/rest_client.py:299
2013-08-20 17:32:45.632 27610 INFO tempest.common.rest_client [-] Response Status: 200
2013-08-20 17:32:45.633 27610 DEBUG tempest.common.rest_client [-] Response Headers: {'date': 'Tue, 20 Aug 2013 09:32:45 GMT', 'content-length': '223', 'content-type': 'application/json', 'x-compute-request-id': 'req-7241918d-2c3a-41fd-84e3-0341634e3190'} _log_response /opt/stack/tempest/tempest/common/rest_client.py:310
2013-08-20 17:32:45.633 27610 DEBUG tempest.common.rest_client [-] Response Body: {"aggregate": {"name": "test_aggregate_1028841100", "availability_zone": null, "deleted": 0, "created_at": "2013-08-20T09:32:45.000000", "updated_at": null, "hosts": ["zhubo"], "deleted_at": null, "id": 27, "metadata": {}}} _log_response /opt/stack/tempest/tempest/common/rest_client.py:314
2013-08-20 17:32:45.633 27610 INFO tempest.common.rest_client [-] Request: POST http://192.168.1.101:8774/v3/os-aggregates/27/action
2013-08-20 17:32:45.633 27610 DEBUG tempest.common.rest_client [-] Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<Token omitted>'} _log_request /opt/stack/tempest/tempest/common/rest_client.py:295
2013-08-20 17:32:45.633 27610 DEBUG tempest.common.rest_client [-] Request Body: {"remove_host": {"host": "zhubo"}} _log_request /opt/stack/tempest/tempest/common/rest_client.py:299
2013-08-20 17:32:45.719 27610 INFO tempest.common.rest_client [-] Response Status: 200
2013-08-20 17:32:45.720 27610 DEBUG tempest.common.rest_client [-] Response Headers: {'date': 'Tue, 20 Aug 2013 09:32:45 GMT', 'content-length': '216', 'content-type': 'application/json', 'x-compute-request-id': 'req-ce64a2ba-89de-4297-a773-ed2e0b5b282e'} _log_response /opt/stack/tempest/tempest/common/rest_client.py:310
2013-08-20 17:32:45.720 27610 DEBUG tempest.common.rest_client [-] Response Body: {"aggregate": {"name": "test_aggregate_1028841100", "availability_zone": null, "deleted": 0, "created_at": "2013-08-20T09:32:45.000000", "updated_at": null, "hosts": [], "deleted_at": null, "id": 27, "metadata": {}}} _log_response /opt/stack/tempest/tempest/common/rest_client.py:314
2013-08-20 17:32:45.720 27610 DEBUG tempest.openstack.common.lockutils [-] Released file lock "availability_zone" at /opt/stack/data/tempest/tempest-availability_zone lock /opt/stack/tempest/tempest/openstack/common/lockutils.py:208
2013-08-20 17:32:45.722 27610 INFO tempest.common.rest_client [-] Request: DELETE http://192.168.1.101:8774/v3/os-aggregates/27
2013-08-20 17:32:45.723 27610 DEBUG tempest.common.rest_client [-] Request Headers: {'X-Auth-Token': '<Token omitted>'} _log_request /opt/stack/tempest/tempest/common/rest_client.py:295
2013-08-20 17:32:45.771 27610 INFO tempest.common.rest_client [-] Response Status: 204
2013-08-20 17:32:45.771 27610 DEBUG tempest.common.rest_client [-] Response Headers: {'date': 'Tue, 20 Aug 2013 09:32:45 GMT', 'content-length': '0', 'content-type': 'application/json', 'x-compute-request-id': 'req-0570302c-758e-4edb-8331-dd14f2a1aa5b'} _log_response /opt/stack/tempest/tempest/common/rest_client.py:310

the nova log is following:
2013-08-20 17:32:45.454 DEBUG routes.middleware [-] Matched POST /os-aggregates from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:100
2013-08-20 17:32:45.455 DEBUG routes.middleware [-] Route path: '/os-aggregates', defaults: {'action': u'create', 'controller': <nova.api.openstack.wsgi.Resource object at 0x3821d50>} from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:102
2013-08-20 17:32:45.455 DEBUG routes.middleware [-] Match dict: {'action': u'create', 'controller': <nova.api.openstack.wsgi.Resource object at 0x3821d50>} from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:103
2013-08-20 17:32:45.455 DEBUG nova.api.openstack.wsgi [req-8cb24fc8-b5ff-4e59-869d-4ef1ed146a36 admin admin] Action: 'create', body: {"aggregate": {"name": "test_aggregate_1028841100", "availability_zone": null}} from (pid=23443) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:927
2013-08-20 17:32:45.455 DEBUG nova.api.openstack.wsgi [req-8cb24fc8-b5ff-4e59-869d-4ef1ed146a36 admin admin] Calling method <bound method AggregateController.create of <nova.api.openstack.compute.plugins.v3.aggregates.AggregateController object at 0x3821710>> from (pid=23443) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:928
2013-08-20 17:32:45.533 INFO nova.osapi_compute.wsgi.server [req-8cb24fc8-b5ff-4e59-869d-4ef1ed146a36 admin admin] 192.168.1.101 "POST /v3/os-aggregates HTTP/1.1" status: 201 len: 365 time: 0.0926220

2013-08-20 17:32:45.534 DEBUG keystoneclient.middleware.auth_token [-] Authenticating user token from (pid=23443) __call__ /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:448
2013-08-20 17:32:45.535 DEBUG keystoneclient.middleware.auth_token [-] Removing headers from request environment: X-Identity-Status,X-Domain-Id,X-Domain-Name,X-Project-Id,X-Project-Name,X-Project-Domain-Id,X-Project-Domain-Name,X-User-Id,X-User-Name,X-User-Domain-Id,X-User-Domain-Name,X-Roles,X-Service-Catalog,X-User,X-Tenant-Id,X-Tenant-Name,X-Tenant,X-Role from (pid=23443) _remove_auth_headers /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:506
2013-08-20 17:32:45.535 DEBUG keystoneclient.middleware.auth_token [-] Returning cached token b768c2ef43232acf1c228967cd248503 from (pid=23443) _cache_get /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:893
2013-08-20 17:32:45.536 DEBUG routes.middleware [-] Matched POST /os-aggregates/27/action from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:100
2013-08-20 17:32:45.536 DEBUG routes.middleware [-] Route path: '/os-aggregates/:(id)/action', defaults: {'action': u'action', 'controller': <nova.api.openstack.wsgi.Resource object at 0x3821d50>} from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:102
2013-08-20 17:32:45.536 DEBUG routes.middleware [-] Match dict: {'action': u'action', 'controller': <nova.api.openstack.wsgi.Resource object at 0x3821d50>, 'id': u'27'} from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:103
2013-08-20 17:32:45.536 DEBUG nova.api.openstack.wsgi [req-7241918d-2c3a-41fd-84e3-0341634e3190 admin admin] Action: 'action', body: {"add_host": {"host": "zhubo"}} from (pid=23443) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:927
2013-08-20 17:32:45.537 DEBUG nova.api.openstack.wsgi [req-7241918d-2c3a-41fd-84e3-0341634e3190 admin admin] Calling method <bound method AggregateController.wrapped of <nova.api.openstack.compute.plugins.v3.aggregates.AggregateController object at 0x3821710>> from (pid=23443) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:928
2013-08-20 17:32:45.617 DEBUG nova.openstack.common.rpc.amqp [req-7241918d-2c3a-41fd-84e3-0341634e3190 admin admin] Making asynchronous cast on compute.zhubo... from (pid=23443) cast /opt/stack/nova/nova/openstack/common/rpc/amqp.py:542
2013-08-20 17:32:45.618 DEBUG nova.openstack.common.rpc.amqp [req-7241918d-2c3a-41fd-84e3-0341634e3190 admin admin] UNIQUE_ID is dcdf9ce8be974a8ebbc5808e0f6d1285. from (pid=23443) _add_unique_id /opt/stack/nova/nova/openstack/common/rpc/amqp.py:322
2013-08-20 17:32:45.619 DEBUG amqp [-] Closed channel #1 from (pid=23443) _do_close /usr/local/lib/python2.7/dist-packages/amqp/channel.py:88
2013-08-20 17:32:45.619 DEBUG amqp [-] using channel_id: 1 from (pid=23443) __init__ /usr/local/lib/python2.7/dist-packages/amqp/channel.py:70
2013-08-20 17:32:45.620 DEBUG amqp [-] Channel open from (pid=23443) _open_ok /usr/local/lib/python2.7/dist-packages/amqp/channel.py:420
2013-08-20 17:32:45.632 INFO nova.osapi_compute.wsgi.server [req-7241918d-2c3a-41fd-84e3-0341634e3190 admin admin] 192.168.1.101 "POST /v3/os-aggregates/27/action HTTP/1.1" status: 200 len: 396 time: 0.0971949

2013-08-20 17:32:45.635 DEBUG keystoneclient.middleware.auth_token [-] Authenticating user token from (pid=23443) __call__ /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:448
2013-08-20 17:32:45.635 DEBUG keystoneclient.middleware.auth_token [-] Removing headers from request environment: X-Identity-Status,X-Domain-Id,X-Domain-Name,X-Project-Id,X-Project-Name,X-Project-Domain-Id,X-Project-Domain-Name,X-User-Id,X-User-Name,X-User-Domain-Id,X-User-Domain-Name,X-Roles,X-Service-Catalog,X-User,X-Tenant-Id,X-Tenant-Name,X-Tenant,X-Role from (pid=23443) _remove_auth_headers /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:506
2013-08-20 17:32:45.635 DEBUG keystoneclient.middleware.auth_token [-] Returning cached token b768c2ef43232acf1c228967cd248503 from (pid=23443) _cache_get /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:893
2013-08-20 17:32:45.637 DEBUG routes.middleware [-] Matched POST /os-aggregates/27/action from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:100
2013-08-20 17:32:45.637 DEBUG routes.middleware [-] Route path: '/os-aggregates/:(id)/action', defaults: {'action': u'action', 'controller': <nova.api.openstack.wsgi.Resource object at 0x3821d50>} from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:102
2013-08-20 17:32:45.637 DEBUG routes.middleware [-] Match dict: {'action': u'action', 'controller': <nova.api.openstack.wsgi.Resource object at 0x3821d50>, 'id': u'27'} from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:103
2013-08-20 17:32:45.638 DEBUG nova.api.openstack.wsgi [req-ce64a2ba-89de-4297-a773-ed2e0b5b282e admin admin] Action: 'action', body: {"remove_host": {"host": "zhubo"}} from (pid=23443) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:927
2013-08-20 17:32:45.638 DEBUG nova.api.openstack.wsgi [req-ce64a2ba-89de-4297-a773-ed2e0b5b282e admin admin] Calling method <bound method AggregateController.wrapped of <nova.api.openstack.compute.plugins.v3.aggregates.AggregateController object at 0x3821710>> from (pid=23443) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:928
2013-08-20 17:32:45.710 DEBUG nova.openstack.common.rpc.amqp [req-ce64a2ba-89de-4297-a773-ed2e0b5b282e admin admin] Making asynchronous cast on compute.zhubo... from (pid=23443) cast /opt/stack/nova/nova/openstack/common/rpc/amqp.py:542
2013-08-20 17:32:45.710 DEBUG nova.openstack.common.rpc.amqp [req-ce64a2ba-89de-4297-a773-ed2e0b5b282e admin admin] UNIQUE_ID is e5573daa804945ef84bf202cb467ee21. from (pid=23443) _add_unique_id /opt/stack/nova/nova/openstack/common/rpc/amqp.py:322
2013-08-20 17:32:45.712 DEBUG amqp [-] Closed channel #1 from (pid=23443) _do_close /usr/local/lib/python2.7/dist-packages/amqp/channel.py:88
2013-08-20 17:32:45.712 DEBUG amqp [-] using channel_id: 1 from (pid=23443) __init__ /usr/local/lib/python2.7/dist-packages/amqp/channel.py:70
2013-08-20 17:32:45.712 DEBUG amqp [-] Channel open from (pid=23443) _open_ok /usr/local/lib/python2.7/dist-packages/amqp/channel.py:420
2013-08-20 17:32:45.719 INFO nova.osapi_compute.wsgi.server [req-ce64a2ba-89de-4297-a773-ed2e0b5b282e admin admin] 192.168.1.101 "POST /v3/os-aggregates/27/action HTTP/1.1" status: 200 len: 389 time: 0.0844562

2013-08-20 17:32:45.723 DEBUG keystoneclient.middleware.auth_token [-] Authenticating user token from (pid=23443) __call__ /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:448
2013-08-20 17:32:45.724 DEBUG keystoneclient.middleware.auth_token [-] Removing headers from request environment: X-Identity-Status,X-Domain-Id,X-Domain-Name,X-Project-Id,X-Project-Name,X-Project-Domain-Id,X-Project-Domain-Name,X-User-Id,X-User-Name,X-User-Domain-Id,X-User-Domain-Name,X-Roles,X-Service-Catalog,X-User,X-Tenant-Id,X-Tenant-Name,X-Tenant,X-Role from (pid=23443) _remove_auth_headers /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:506
2013-08-20 17:32:45.724 DEBUG keystoneclient.middleware.auth_token [-] Returning cached token b768c2ef43232acf1c228967cd248503 from (pid=23443) _cache_get /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:893
2013-08-20 17:32:45.725 DEBUG routes.middleware [-] Matched DELETE /os-aggregates/27 from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:100
2013-08-20 17:32:45.725 DEBUG routes.middleware [-] Route path: '/os-aggregates/:(id)', defaults: {'action': u'delete', 'controller': <nova.api.openstack.wsgi.Resource object at 0x3821d50>} from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:102
2013-08-20 17:32:45.725 DEBUG routes.middleware [-] Match dict: {'action': u'delete', 'controller': <nova.api.openstack.wsgi.Resource object at 0x3821d50>, 'id': u'27'} from (pid=23443) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:103
2013-08-20 17:32:45.725 DEBUG nova.api.openstack.wsgi [req-0570302c-758e-4edb-8331-dd14f2a1aa5b admin admin] No Content-Type provided in request from (pid=23443) get_body /opt/stack/nova/nova/api/openstack/wsgi.py:801
2013-08-20 17:32:45.725 DEBUG nova.api.openstack.wsgi [req-0570302c-758e-4edb-8331-dd14f2a1aa5b admin admin] Calling method <bound method AggregateController.delete of <nova.api.openstack.compute.plugins.v3.aggregates.AggregateController object at 0x3821710>> from (pid=23443) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:928
2013-08-20 17:32:45.770 INFO nova.osapi_compute.wsgi.server [req-0570302c-758e-4edb-8331-dd14f2a1aa5b admin admin] 192.168.1.101 "DELETE /v3/os-aggregates/27 HTTP/1.1" status: 204 len: 179 time: 0.0466759

Tags: api
Ivan-Zhu (ivan-zhu)
Changed in nova:
assignee: nobody → Christopher Yeoh (cyeoh-0)
Matt Riedemann (mriedem)
tags: added: api
Revision history for this message
Alex Xu (xuhj) wrote :
Changed in nova:
status: New → In Progress
assignee: Christopher Yeoh (cyeoh-0) → Alex Xu (xuhj)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/43039
Committed: http://github.com/openstack/nova/commit/a66867277f4e704fd89703245f644b161309e1ac
Submitter: Jenkins
Branch: master

commit a66867277f4e704fd89703245f644b161309e1ac
Author: He Jie Xu <email address hidden>
Date: Tue Aug 20 14:28:45 2013 +0800

    Add expected_errors for extension aggregates v3

    And remove some extra invalid params checking that
    we didn't check in most of extensions. We can do
    more strict checking when we have API input validation.

    Fix bug 1214315
    Partially implements bp v3-api-extension-versioning

    Change-Id: I9c1f8265ea6e19e48cc2f8e747d04d3c3b66e55d

Alex Xu (xuhj)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-rc1 → 2013.2
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.