yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #00756
[Bug 1102462] Re: List servers having non-existent flavor returns 422 Unprocessable Entity instead of empty list
** Changed in: nova
Status: Fix Committed => Fix Released
** Changed in: nova
Milestone: None => grizzly-3
--
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/1102462
Title:
List servers having non-existent flavor returns 422 Unprocessable
Entity instead of empty list
Status in OpenStack Compute (Nova):
Fix Released
Bug description:
Discovered running Tempest:
07:17:00 ======================================================================
07:17:00 ERROR: test_list_servers_by_non_existing_flavor (tempest.tests.compute.servers.test_list_servers_negative.ListServersNegativeTest)
07:17:00 ----------------------------------------------------------------------
07:17:00 Traceback (most recent call last):
07:17:00 File "/opt/stack/new/tempest/tempest/tests/compute/servers/test_list_servers_negative.py", line 121, in test_list_servers_by_non_existing_flavor
07:17:00 resp, body = self.client.list_servers(dict(flavor=non_existing_flavor))
07:17:00 File "/opt/stack/new/tempest/tempest/services/compute/json/servers_client.py", line 129, in list_servers
07:17:00 resp, body = self.get(url)
07:17:00 File "/opt/stack/new/tempest/tempest/common/rest_client.py", line 179, in get
07:17:00 return self.request('GET', url, headers, wait=wait)
07:17:00 File "/opt/stack/new/tempest/tempest/common/rest_client.py", line 308, in request
07:17:00 raise exceptions.TempestException(str(resp.status))
07:17:00 TempestException: An unknown exception occurred
07:17:00 Details: An unknown exception occurred
07:17:00 Details: 422
07:17:00 -------------------- >> begin captured logging << --------------------
07:17:00 tempest.common.rest_client: ERROR: Request URL: http://127.0.0.1:8774/v2/6ddb2f83e4ad4a0da7bf9e7a7f1df6da/servers?flavor=1234
07:17:00 tempest.common.rest_client: ERROR: Request Body: None
07:17:00 tempest.common.rest_client: ERROR: Response Headers: {'date': 'Mon, 21 Jan 2013 07:07:54 GMT', 'status': '422', 'content-length': '71', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-69a003d4-8e42-48eb-be45-c0280952912b'}
07:17:00 tempest.common.rest_client: ERROR: Response Body: {u'computeFault': {u'message': u'Flavor could not be found', u'code': 422}}
07:17:00 --------------------- >> end captured logging << ---------------------
The source of the issue is plain:
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L542
compute_api.get_all() is raising FlavorNotFound if search_opts
includes a non-existing flavor ID.
Since this is list operation, shouldn't the result of GET /servers
that finds no matches be an empty list?
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1102462/+subscriptions