From ca96b0a169f3a6c13b20775267f8be8077ffad53 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Tue, 9 Jul 2013 16:59:12 +0200 Subject: [PATCH] Add variable to specify additional parameters for the Neutron service. This patch adds a new variable, Q_SRV_EXTRA_DEFAULT_OPTS, which can override any parameter of the [DEFAULT] section of the neutron.conf file. It can be used for example to define the number of DHCP agents that should host a network: Q_SRV_EXTRA_DEFAULT_OPTS=(dhcp_agents_per_network=2) Change-Id: Ic34164457e64dec6ca8ec76be1772f998d100991 --- README.md | 11 ++++++----- lib/neutron | 8 ++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6fcd01d7ce..5fd4291df5 100644 --- a/README.md +++ b/README.md @@ -122,13 +122,14 @@ In order to enable Neutron a single node setup, you'll need the following settin Then run `stack.sh` as normal. -devstack supports adding specific Neutron configuration flags to both the Open vSwitch and LinuxBridge plugin configuration files. To make use of this feature, the following variables are defined and can be configured in your `localrc` file: +devstack supports adding specific Neutron configuration flags to the service, Open vSwitch plugin and LinuxBridge plugin configuration files. To make use of this feature, the following variables are defined and can be configured in your `localrc` file: - Variable Name Plugin Config File Section Modified + Variable Name Config File Section Modified ------------------------------------------------------------------------------------- - Q_SRV_EXTRA_OPTS `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge) - Q_AGENT_EXTRA_AGENT_OPTS AGENT - Q_AGENT_EXTRA_SRV_OPTS `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge) + Q_SRV_EXTRA_OPTS Plugin `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge) + Q_AGENT_EXTRA_AGENT_OPTS Plugin AGENT + Q_AGENT_EXTRA_SRV_OPTS Plugin `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge) + Q_SRV_EXTRA_DEFAULT_OPTS Service DEFAULT An example of using the variables in your `localrc` is below: diff --git a/lib/neutron b/lib/neutron index c28bd28fb0..5da7cfc34e 100644 --- a/lib/neutron +++ b/lib/neutron @@ -614,6 +614,14 @@ function _configure_neutron_service() { iniset $NEUTRON_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY _neutron_setup_keystone $NEUTRON_CONF keystone_authtoken + # Define extra "DEFAULT" configuration options when q-svc is configured by + # defining the array ``Q_SRV_EXTRA_DEFAULT_OPTS``. + # For Example: ``Q_SRV_EXTRA_DEFAULT_OPTS=(foo=true bar=2)`` + for I in "${Q_SRV_EXTRA_DEFAULT_OPTS[@]}"; do + # Replace the first '=' with ' ' for iniset syntax + iniset $NEUTRON_CONF DEFAULT ${I/=/ } + done + # Configure plugin neutron_plugin_configure_service }