From 95b326e7ae7a5534a2da383fd07649030fe94a37 Mon Sep 17 00:00:00 2001 From: James Arendt Date: Tue, 1 Sep 2015 15:27:26 -0700 Subject: [PATCH] Fix Neutron flavor framework Make flavor service profile store actual driver instead of hardcoded dummy driver. Ensure service type on flavor persisted. Raise ServiceProfileDriverNotFound if non-empty driver is not part of ServiceTypeManager providers. Raise ServiceProfileEmpty if profile has neither a driver nor any metainfo. Raise InvalidFlavorServiceType if invalid service type passed. Show flavors associated with a profile, not just profiles associated with a flavor, to ease diagnosis when ServiceProfileInUse raised. Create method to extract provider given a flavor for use with neutron-lbaas plus tests. Ensure various boolean forms accepted for enabled flag. To enable in DevStack, add to local.conf: enable_plugin neutron https://git.openstack.org/openstack/neutron enable_service q-flavors Add associated unit tests. Fix tempest api test that used invalid LOADBALANCERS service type. Change-Id: I5c22ab655a8e2a2e586c10eae9de9b72db49755f Implements: blueprint neutron-flavor-framework --- devstack/plugin.sh | 6 +++++- etc/policy.json | 6 +++++- neutron/tests/etc/policy.json | 6 +++++- setup.cfg | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index d652698a..6038e7e4 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -1,5 +1,6 @@ LIBDIR=$DEST/neutron/devstack/lib +source $LIBDIR/flavors source $LIBDIR/l2_agent source $LIBDIR/l2_agent_sriovnicswitch source $LIBDIR/ml2 @@ -8,6 +9,9 @@ source $LIBDIR/qos if [[ "$1" == "stack" ]]; then case "$2" in install) + if is_service_enabled q-flavors; then + configure_flavors + fi if is_service_enabled q-qos; then configure_qos fi @@ -37,4 +41,4 @@ elif [[ "$1" == "unstack" ]]; then if is_service_enabled q-sriov-agt; then stop_l2_agent_sriov fi -fi \ No newline at end of file +fi diff --git a/etc/policy.json b/etc/policy.json index c39ce3c4..c551eb81 100644 --- a/etc/policy.json +++ b/etc/policy.json @@ -199,5 +199,9 @@ "update_rbac_policy": "rule:admin_or_owner", "update_rbac_policy:target_tenant": "rule:restrict_wildcard and rule:admin_or_owner", "get_rbac_policy": "rule:admin_or_owner", - "delete_rbac_policy": "rule:admin_or_owner" + "delete_rbac_policy": "rule:admin_or_owner", + + "create_flavor_service_profile": "rule:admin_only", + "delete_flavor_service_profile": "rule:admin_only", + "get_flavor_service_profile": "rule:regular_user" } diff --git a/neutron/tests/etc/policy.json b/neutron/tests/etc/policy.json index c39ce3c4..c551eb81 100644 --- a/neutron/tests/etc/policy.json +++ b/neutron/tests/etc/policy.json @@ -199,5 +199,9 @@ "update_rbac_policy": "rule:admin_or_owner", "update_rbac_policy:target_tenant": "rule:restrict_wildcard and rule:admin_or_owner", "get_rbac_policy": "rule:admin_or_owner", - "delete_rbac_policy": "rule:admin_or_owner" + "delete_rbac_policy": "rule:admin_or_owner", + + "create_flavor_service_profile": "rule:admin_only", + "delete_flavor_service_profile": "rule:admin_only", + "get_flavor_service_profile": "rule:regular_user" } diff --git a/setup.cfg b/setup.cfg index 9c9a3bca..1fa52764 100644 --- a/setup.cfg +++ b/setup.cfg @@ -115,6 +115,7 @@ neutron.service_plugins = neutron.services.loadbalancer.plugin.LoadBalancerPlugin = neutron_lbaas.services.loadbalancer.plugin:LoadBalancerPlugin neutron.services.vpn.plugin.VPNDriverPlugin = neutron_vpnaas.services.vpn.plugin:VPNDriverPlugin qos = neutron.services.qos.qos_plugin:QoSPlugin + flavors = neutron.services.flavors.flavors_plugin:FlavorsPlugin neutron.qos.notification_drivers = message_queue = neutron.services.qos.notification_drivers.message_queue:RpcQosServiceNotificationDriver neutron.ml2.type_drivers =