From 9c8d7af26eda8694c94be27d769b4bd6e8c1709d Mon Sep 17 00:00:00 2001 From: yuntong Date: Mon, 5 Jan 2015 13:52:44 +0800 Subject: [PATCH] Remove unused function _get_flavor_refs in flavor_access extension Function _get_flavor_refs never be used in any code, this patch is to remove it in flavor_access extension for both v2 and v2.1 API. Partially implements blueprint v2-on-v3-api Change-Id: Ibbe91227e98b2ccddd1892ed43e54ac526fe7664 --- nova/api/openstack/compute/contrib/flavor_access.py | 9 --------- nova/api/openstack/compute/plugins/v3/flavor_access.py | 9 --------- 2 files changed, 18 deletions(-) diff --git a/nova/api/openstack/compute/contrib/flavor_access.py b/nova/api/openstack/compute/contrib/flavor_access.py index 198dfbb8e2..200a1111e5 100644 --- a/nova/api/openstack/compute/contrib/flavor_access.py +++ b/nova/api/openstack/compute/contrib/flavor_access.py @@ -110,15 +110,6 @@ class FlavorActionController(wsgi.Controller): if body is None or body == "": raise webob.exc.HTTPBadRequest(explanation=_("No request body")) - def _get_flavor_refs(self, context): - """Return a dictionary mapping flavorid to flavor_ref.""" - - flavors = objects.FlavorList.get_all(context) - rval = {} - for flavor in flavors: - rval[flavor.flavorid] = flavor - return rval - def _extend_flavor(self, flavor_rval, flavor_ref): key = "%s:is_public" % (Flavor_access.alias) flavor_rval[key] = flavor_ref['is_public'] diff --git a/nova/api/openstack/compute/plugins/v3/flavor_access.py b/nova/api/openstack/compute/plugins/v3/flavor_access.py index 0992281308..77481c0414 100644 --- a/nova/api/openstack/compute/plugins/v3/flavor_access.py +++ b/nova/api/openstack/compute/plugins/v3/flavor_access.py @@ -67,15 +67,6 @@ class FlavorAccessController(wsgi.Controller): class FlavorActionController(wsgi.Controller): """The flavor access API controller for the OpenStack API.""" - def _get_flavor_refs(self, context): - """Return a dictionary mapping flavorid to flavor_ref.""" - - flavors = objects.FlavorList.get_all(context) - rval = {} - for flavor in flavors: - rval[flavor.flavorid] = flavor - return rval - def _extend_flavor(self, flavor_rval, flavor_ref): key = "%s:is_public" % (FlavorAccess.alias) flavor_rval[key] = flavor_ref['is_public']