From e9f7bc4f496f767b4040f28f0c751001fe01c025 Mon Sep 17 00:00:00 2001 From: "Yunhong, Jiang" Date: Tue, 31 Jul 2012 18:15:59 +0800 Subject: [PATCH] Flavor extra specs extension use instance_type id bug 1031263 The nova database API use instance_type id as parameter to access flavor extra spec. However, the flavor extra_specs API extension use flavor_id as parameter wrongly. As the instance_type ID is a purely nova internal ID, the database should not expose it and instead use flavor_id as the parameter Change-Id: I5f509cb7c4457d8c399df32f559a874d498be762 Signed-off-by: Yunhong, Jiang --- bin/nova-manage | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 1bd0691f..020cebbb 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -1003,9 +1003,10 @@ class InstanceTypeCommands(object): ctxt = context.get_admin_context() ext_spec = {key: value} - db.instance_type_extra_specs_update_or_create(ctxt, - inst_type["id"], - ext_spec) + db.instance_type_extra_specs_update_or_create( + ctxt, + inst_type["flavorid"], + ext_spec) print _("Key %(key)s set to %(value)s on instance" " type %(name)s") % locals() except exception.DBError, e: @@ -1025,7 +1026,10 @@ class InstanceTypeCommands(object): sys.exit(2) ctxt = context.get_admin_context() - db.instance_type_extra_specs_delete(ctxt, inst_type["id"], key) + db.instance_type_extra_specs_delete( + ctxt, + inst_type["flavorid"], + key) print _("Key %(key)s on instance type %(name)s unset") % locals() except exception.DBError, e: