From 15e266ce2b9100f3fd8f98230b9ffab9adb163f4 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Tue, 4 Sep 2012 14:16:17 -0700 Subject: Makes sure new flavors default to is_public=True The default for is_public is true in the database, but new flavors created through the extension was defaulting is_public=None and passing it through to the db layer where it gets converted to False. This patch fixes the issue by defaulting is_public to True at the api layer. Incldes a broken test to verify. Fixes bug 1046040 Change-Id: I4c361c0055a14de29e364868074e17cf3ec23220 --- nova/api/openstack/compute/contrib/flavormanage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/contrib/flavormanage.py b/nova/api/openstack/compute/contrib/flavormanage.py index e3d57f3a1..d6bd87005 100644 --- a/nova/api/openstack/compute/contrib/flavormanage.py +++ b/nova/api/openstack/compute/contrib/flavormanage.py @@ -65,7 +65,7 @@ class FlavorManageController(wsgi.Controller): ephemeral_gb = vals.get('OS-FLV-EXT-DATA:ephemeral') swap = vals.get('swap') rxtx_factor = vals.get('rxtx_factor') - is_public = vals.get('os-flavor-access:is_public') + is_public = vals.get('os-flavor-access:is_public', True) try: flavor = instance_types.create(name, memory_mb, vcpus, -- cgit