← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1254616] Re: max_count and min_count should be converted into the type: int

 

** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1254616

Title:
  max_count and min_count should be converted into the type: int

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  when create multiple servers, in nova v3 api,  the min_count and
  min_count should be converted into the type: int. otherwise some
  problem will arise.

  the tempest v3 tests log:
  2013-11-25 16:04:21,000 Request: POST http://9.115.126.211:8774/v3/servers
  2013-11-25 16:04:21,001 Request Headers: {'Content-Type': 'application/xml', 'Accept': 'application/xml', 'X-Auth-Token': '<Token omitted>'}
  2013-11-25 16:04:21,001 Request Body: <?xml version="1.0" encoding="UTF-8"?>
  <server xmlns="http://docs.openstack.org/compute/api/v1.1"; name="multiple-create-test-tempest-917155335" os-multiple-create:max_count="2" os-multiple-create:return_reservation_id="True" xmlns:os-multiple-create="http://docs.openstack.org/compute/ext/multiplecreate/api/v3"; image_ref="08850447-5bfc-49ab-a728-92c056829e99" flavor_ref="42" os-multiple-create:min_count="1"/>
  2013-11-25 16:04:21,684 Response Status: 400
  2013-11-25 16:04:21,684 Nova request id: req-3ad76a84-dfd1-4d5d-8bd9-8a5879b16b6f
  2013-11-25 16:04:21,684 Response Headers: {'content-length': '203', 'date': 'Mon, 25 Nov 2013 08:04:21 GMT', 'content-type': 'application/xml; charset=UTF-8', 'connection': 'close'}
  2013-11-25 16:04:21,684 Response Body: <badRequest code="400" xmlns="http://docs.openstack.org/compute/api/v1.1";><message>The server could not comply with the request since it is either malformed or otherwise incorrect.</message></badRequest>

  
  nova v3 api log:
  2013-11-25 16:04:21.679 ERROR nova.api.openstack.wsgi [req-3ad76a84-dfd1-4d5d-8bd9-8a5879b16b6f demo demo] Exception handling resource: coercing to Unicode: need string or buffer, long found
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi Traceback (most recent call last):
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 999, in _process_stack
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     action_result = self.dispatch(meth, request, action_args)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 1080, in dispatch
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     return method(req=request, **action_args)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/api/openstack/compute/plugins/v3/servers.py", line 773, in create
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     **create_kwargs)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/hooks.py", line 105, in inner
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     rv = f(*args, **kwargs)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/compute/api.py", line 1234, in create
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     legacy_bdm=legacy_bdm)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/compute/api.py", line 883, in _create_instance
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     block_device_mapping)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/compute/api.py", line 759, in _provision_instances
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     context, instance_type, min_count, max_count)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/compute/api.py", line 344, in _check_num_instances_quota
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     cores=req_cores, ram=req_ram)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/quota.py", line 1272, in reserve
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     user_id=user_id)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/quota.py", line 500, in reserve
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     project_id=project_id, user_id=user_id)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/db/api.py", line 1097, in quota_reserve
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     project_id=project_id, user_id=user_id)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 130, in wrapper
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     return f(*args, **kwargs)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 168, in wrapped
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     return f(*args, **kwargs)
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi   File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 3186, in quota_reserve
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi     project_usages[res]['total'] or
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi TypeError: coercing to Unicode: need string or buffer, long found
  2013-11-25 16:04:21.679 TRACE nova.api.openstack.wsgi 
  2013-11-25 16:04:21.682 DEBUG nova.api.openstack.wsgi [req-3ad76a84-dfd1-4d5d-8bd9-8a5879b16b6f demo demo] Returning 400 to user: The server could not comply with the request since it is either malformed or otherwise incorrect. from (pid=10829) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1225
  2013-11-25 16:04:21.683 INFO nova.osapi_compute.wsgi.server [req-3ad76a84-dfd1-4d5d-8bd9-8a5879b16b6f demo demo] 9.115.126.211 "POST /v3/servers HTTP/1.1" status: 400 len: 418 time: 0.6807010

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1254616/+subscriptions