summaryrefslogtreecommitdiffstats
path: root/nova/db
diff options
context:
space:
mode:
authorAlex Meade <alex.meade@rackspace.com>2011-07-01 15:07:08 +0000
committerTarmac <>2011-07-01 15:07:08 +0000
commitb69eaefcccc682a270a66ce33b9083ba40a1a71f (patch)
tree7f9c567ab0b28dcadc605cef2d12da20729f3b2a /nova/db
parent7d544631f0c767727c5a48627617d995f8890ae6 (diff)
parent73a4b0496e1973d3d8af699d0d0d50829ef026c3 (diff)
Fixed the case where an exception was thrown when trying to get a list of flavors via the api yet there were no flavors to list.
hand tested :)
Diffstat (limited to 'nova/db')
-rw-r--r--nova/db/sqlalchemy/api.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index c08d3dbb5..ffd009513 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -2944,13 +2944,11 @@ def instance_type_get_all(context, inactive=False):
filter_by(deleted=False).\
order_by("name").\
all()
+ inst_dict = {}
if inst_types:
- inst_dict = {}
for i in inst_types:
inst_dict[i['name']] = _dict_with_extra_specs(i)
- return inst_dict
- else:
- raise exception.NoInstanceTypesFound()
+ return inst_dict
@require_context