← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1253089] Re: An Unexpected API Error return when call nova v3 api with not enough parameters

 

** 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/1253089

Title:
  An Unexpected API Error return when call nova v3 api with not enough
  parameters

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  when port the following test into v3: 
          meta = {'meta1': 'data1'}
          self.assertRaises(exceptions.BadRequest,
                            self.client.set_server_metadata,
                            self.server_id, meta=meta, no_metadata_field=True)
  The post body will be empty.

  when the following action in server_metadata, receive the request will raise a TypeError, but expected_errors will return response with code 500. I think it should be BadRequest (code 400) like v2 api.
   def update_all(self, req, server_id, body):

  the following is the nova log:
  2013-11-20 21:44:44.893 DEBUG routes.middleware [-] Matched PUT /servers/92875aa6-fe0a-47ed-91ec-ff178b0f8de5/metadata from (pid=32588) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:100
  2013-11-20 21:44:44.893 DEBUG routes.middleware [-] Route path: '/servers/{server_id}/metadata', defaults: {'action': u'update_all', 'controller': <nova.api.openstack.wsgi.Resource object at 0x4083e50>} from (pid=32588) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:102
  2013-11-20 21:44:44.894 DEBUG routes.middleware [-] Match dict: {'action': u'update_all', 'server_id': u'92875aa6-fe0a-47ed-91ec-ff178b0f8de5', 'controller': <nova.api.openstack.wsgi.Resource object at 0x4083e50>} from (pid=32588) __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:103
  2013-11-20 21:44:44.896 DEBUG nova.api.openstack.wsgi [req-42c461b8-6104-4a00-89c2-0d7d2a313735 demo demo] Empty body provided in request from (pid=32588) get_body /opt/stack/nova/nova/api/openstack/wsgi.py:841
  2013-11-20 21:44:44.897 DEBUG nova.api.openstack.wsgi [req-42c461b8-6104-4a00-89c2-0d7d2a313735 demo demo] Calling method <bound method ServerMetadataController.update_all of <nova.api.openstack.compute.plugins.v3.server_metadata.ServerMetadataController object at 0x40832d0>> from (pid=32588) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:964
  2013-11-20 21:44:44.897 ERROR nova.api.openstack.extensions [req-42c461b8-6104-4a00-89c2-0d7d2a313735 demo demo] Unexpected exception in API method
  2013-11-20 21:44:44.897 TRACE nova.api.openstack.extensions Traceback (most recent call last):
  2013-11-20 21:44:44.897 TRACE nova.api.openstack.extensions   File "/opt/stack/nova/nova/api/openstack/extensions.py", line 470, in wrapped
  2013-11-20 21:44:44.897 TRACE nova.api.openstack.extensions     return f(*args, **kwargs)
  2013-11-20 21:44:44.897 TRACE nova.api.openstack.extensions TypeError: update_all() takes exactly 4 arguments (3 given)
  2013-11-20 21:44:44.897 TRACE nova.api.openstack.extensions 
  2013-11-20 21:44:44.898 INFO nova.api.openstack.wsgi [req-42c461b8-6104-4a00-89c2-0d7d2a313735 demo demo] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
  <type 'exceptions.TypeError'>

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