diff options
| author | William Wolf <throughnothing@gmail.com> | 2011-07-21 12:02:01 -0400 |
|---|---|---|
| committer | William Wolf <throughnothing@gmail.com> | 2011-07-21 12:02:01 -0400 |
| commit | dc616cd633007aa83d7576ae74cf807aa0df6776 (patch) | |
| tree | d93c30b3088b00e66d3158ccfede23e197416c03 /nova/api | |
| parent | 9a843b10f3145405ebc01ded5d32ce68d02fdd8d (diff) | |
fixed another issue with invalid flavor_id parsing, and added tests
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/create_instance_helper.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py index 10aaa23b1..2b9256896 100644 --- a/nova/api/openstack/create_instance_helper.py +++ b/nova/api/openstack/create_instance_helper.py @@ -102,7 +102,11 @@ class CreateInstanceHelper(object): if personality: injected_files = self._get_injected_files(personality) - flavor_id = self.controller._flavor_id_from_req_data(body) + try: + flavor_id = self.controller._flavor_id_from_req_data(body) + except ValueError as error: + msg = _("Invalid flavorRef provided.") + raise faults.Fault(exc.HTTPBadRequest(explanation=msg)) if not 'name' in body['server']: msg = _("Server name is not defined") |
