diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-09-10 12:15:02 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-09-10 12:17:57 -0700 |
| commit | d741328543ad6059bef56adb59f4c94781eaedcd (patch) | |
| tree | 8d26b55cd4f1a3108bffdd4f5ffdb0b843c73d82 /nova/api | |
| parent | 641223db012211b353658dabaec27942e89ee5c6 (diff) | |
Fix flavor deletion when there is a deleted flavor
If there is a deleted flavor with the same ID as an undeleted flavor,
the flavormanage delete code attempts to delete it again, which fails.
This patch makes sure to pass read_deleted='no' when the flavor is
retrieved for deletion so we get the undeleted flavor. Includes a
failing test to make sure the value is passed properly.
Fixes bug 1048678
Change-Id: If6a20de2526b7ba90ada4a40317a98f79b2141dc
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/flavormanage.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/contrib/flavormanage.py b/nova/api/openstack/compute/contrib/flavormanage.py index a7e313c9c..69d5d6ed9 100644 --- a/nova/api/openstack/compute/contrib/flavormanage.py +++ b/nova/api/openstack/compute/contrib/flavormanage.py @@ -42,7 +42,8 @@ class FlavorManageController(wsgi.Controller): authorize(context) try: - flavor = instance_types.get_instance_type_by_flavor_id(id) + flavor = instance_types.get_instance_type_by_flavor_id( + id, read_deleted="no") except exception.NotFound, e: raise webob.exc.HTTPNotFound(explanation=str(e)) |
