From 31506c0a252f06e283eecc54741f6a3062fbe913 Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Wed, 23 May 2012 13:36:37 -0500 Subject: Permit deleted instance types to be queried for active instances. Fixes bug 994935. This removes the deleted=0 restriction for joining instance_types to instances. Active instances may be using old/deleted instance_types, so we still need to be able to look up that information for show/detail requests. Change-Id: Ica72801f19c7e5b04966e53ed3ea4c330df44ed1 --- nova/compute/instance_types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nova/compute') diff --git a/nova/compute/instance_types.py b/nova/compute/instance_types.py index c4a6f66f9..f0514cb73 100644 --- a/nova/compute/instance_types.py +++ b/nova/compute/instance_types.py @@ -144,5 +144,7 @@ def get_instance_type_by_flavor_id(flavorid): :raises: FlavorNotFound """ - ctxt = context.get_admin_context() + # NOTE(jk0): Reading deleted is OK here because we're an admin and querying + # flavors directly. + ctxt = context.get_admin_context(read_deleted="yes") return db.instance_type_get_by_flavor_id(ctxt, flavorid) -- cgit