From 35b3c08a463dd35a41f3c44f3fa8273b915cb378 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 19 Jan 2012 18:39:11 -0500 Subject: Add an API extension for creating+deleting flavors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This extension is a step towards deprecating openstackx for horizon. Most of the extension code is based on the equivalent in openstackx. v2: s/lifecycle/manage/ for all bits Address Pádraig style issues Drop purge API option Adjust now inaccurate comment in DB api Make extension admin_only Extend existing /flavors namespace rather than os-flavor-lifecycle Only allow API access from admin user v3: Some pep8 fixes v4: Adjust to root_gb, ephemeral_gb changes Drop admin_only (it's on the way out AIUI) Change-Id: I3fdfccdd8e7337e1759f5875c3b15fa9954371ef --- nova/db/sqlalchemy/api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nova/db') diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 2e5f40a3c..5577fb932 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -3340,13 +3340,13 @@ def instance_type_create(context, values): instance_type_ref.save() except Exception, e: raise exception.DBError(e) - return instance_type_ref + return _dict_with_extra_specs(instance_type_ref) def _dict_with_extra_specs(inst_type_query): - """Takes an instance OR volume type query returned by sqlalchemy - and returns it as a dictionary, converting the extra_specs - entry from a list of dicts: + """Takes an instance, volume, or instance type query returned + by sqlalchemy and returns it as a dictionary, converting the + extra_specs entry from a list of dicts: 'extra_specs' : [{'key': 'k1', 'value': 'v1', ...}, ...] -- cgit