From e142d21b47e8895a013c468936e69ba0e7e66041 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 24 Oct 2012 10:15:39 -0400 Subject: Return empty list when listing servers with bad status value API indicates the status parameter is a string, hence status=BALONEY is a valid filter that should return zero records since no records match that status. The return should be an empty list and 200 OK. Fixes bug 1061712 Change-Id: If796110a18dd75ab5c5d4ba41e9c3b58180341f8 --- nova/api/openstack/compute/servers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index c5e829d52..ef102dc0b 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -490,8 +490,7 @@ class Controller(wsgi.Controller): if status is not None: state = common.vm_state_from_status(status) if state is None: - msg = _('Invalid server status: %(status)s') % locals() - raise exc.HTTPBadRequest(explanation=msg) + return {'servers': []} search_opts['vm_state'] = state if 'changes-since' in search_opts: -- cgit