cell create api failed with string number

Bug #1389933 reported by Alex Xu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Alex Xu

Bug Description

When request as below:
curl -i 'http://cloudcontroller:8774/v2/04e2ab93c10a4c2dbef1c648d04567cc/os-cells' -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: python-novaclient" -H "X-Auth-Project-Id: admin" -H "X-Auth-Token: 016d26c590ab4a0b91de718d01d7a649" -d '{"cell": {"name": "abc", "rpc_port": "123"}}'

Get error as below:
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi Traceback (most recent call last):
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 950, in _process_stack
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi action_result = self.dispatch(meth, request, action_args)
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 1034, in dispatch
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi return method(req=request, **action_args)
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/openstack/compute/contrib/cells.py", line 360, in create
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi self._normalize_cell(cell)
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi File "/opt/stack/nova/nova/api/openstack/compute/contrib/cells.py", line 340, in _normalize_cell
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi cell['transport_url'] = str(transport_url)
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/transport.py", line 318, in __str__
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi netloc += ':%d' % port
2014-11-06 10:41:37.099 TRACE nova.api.openstack.wsgi TypeError: %d format: a number is required, not unicode

Alex Xu (xuhj)
Changed in nova:
assignee: nobody → Alex Xu (xuhj)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/132941
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=09b0f2e622eaa2ee02c2a7ddead6e79f94d9c06c
Submitter: Jenkins
Branch: master

commit 09b0f2e622eaa2ee02c2a7ddead6e79f94d9c06c
Author: He Jie Xu <email address hidden>
Date: Thu Nov 6 10:59:08 2014 +0800

    Fix the cell API with string rpc_port failed

    When cell create/update accept rpc_port as string, it will
    return 500. This patch add code to covert the string as integer.

    Change-Id: I8ace46731ac02f810b978c54843b6e137c9882be
    Closes-Bug: #1389933

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-1 → 2015.1.0
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.