From 46cf865831fdb50a1da0044ca83cc4f0de8876e4 Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Wed, 26 Oct 2011 14:04:42 +0000 Subject: Speed up test suite by 20 seconds Change openstack API server actions test to use controller directly, bypassing WSGI layer. This shaves up to half a second off each test and can speed up test suite by 20 seconds. Change-Id: Ideadbeef2232753eae628d0ffdd534055f1dbc40 --- nova/api/openstack/servers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index f4844e0e7..3a16b0c7d 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -781,11 +781,11 @@ class Controller(object): if (not 'changePassword' in input_dict or not 'adminPass' in input_dict['changePassword']): msg = _("No adminPass was specified") - return exc.HTTPBadRequest(explanation=msg) + raise exc.HTTPBadRequest(explanation=msg) password = input_dict['changePassword']['adminPass'] if not isinstance(password, basestring) or password == '': msg = _("Invalid adminPass") - return exc.HTTPBadRequest(explanation=msg) + raise exc.HTTPBadRequest(explanation=msg) self.compute_api.set_admin_password(context, id, password) return webob.Response(status_int=202) -- cgit