From c6b3b76a495613ffeec6616f7b78e5265308077c Mon Sep 17 00:00:00 2001 From: Ryan O'Hara Date: Wed, 29 May 2013 11:23:44 -0500 Subject: [PATCH] Use CONFIG_QUANTUM_OVS_BRIDGE_MAPPINGS parameter The CONFIG_QUANTUM_OVS_BRIDGE_MAPPINGS parameter contains a comma-separated list of bridge mappings. Since the puppet modules expects this parameter to be an array, this parameter must be properly formatted by packstack, then consumed by the puppet module. Change-Id: Ia09a7185f4a6fc8f5e61ca585e35486fe1520687 --- packstack/plugins/quantum_350.py | 11 +++++++++++ packstack/puppet/templates/quantum_ovs_agent.pp | 1 + 2 files changed, 12 insertions(+) diff --git a/packstack/plugins/quantum_350.py b/packstack/plugins/quantum_350.py index 841829a8e..2f7eabb41 100644 --- a/packstack/plugins/quantum_350.py +++ b/packstack/plugins/quantum_350.py @@ -4,6 +4,7 @@ Installs and configures quantum import logging import os +import re import uuid from packstack.installer import utils @@ -348,6 +349,16 @@ def createL2AgentManifests(config): if controller.CONF["CONFIG_QUANTUM_L2_PLUGIN"] == "openvswitch": host_var = 'CONFIG_QUANTUM_OVS_HOST' template_name = 'quantum_ovs_agent.pp' + + # The CONFIG_QUANTUM_OVS_BRIDGE_MAPPINGS parameter contains a + # comma-separated list of bridge mappings. Since the puppet module + # expects this parameter to be an array, this parameter must be properly + # formatted by packstack, then consumed by the puppet module. + # For example, the input string 'A, B, C' should formatted as '['A','B','C']'. + r = re.compile("[\s,]+") + controller.CONF["CONFIG_QUANTUM_OVS_BRIDGE_MAPPINGS"] = \ + str(filter(None, r.split(controller.CONF["CONFIG_QUANTUM_OVS_BRIDGE_MAPPINGS"]))) + elif controller.CONF["CONFIG_QUANTUM_L2_PLUGIN"] == "linuxbridge": host_var = 'CONFIG_QUANTUM_LB_HOST' template_name = 'quantum_lb_agent.pp' diff --git a/packstack/puppet/templates/quantum_ovs_agent.pp b/packstack/puppet/templates/quantum_ovs_agent.pp index c54b824de..35f89a888 100644 --- a/packstack/puppet/templates/quantum_ovs_agent.pp +++ b/packstack/puppet/templates/quantum_ovs_agent.pp @@ -1,2 +1,3 @@ class { 'quantum::agents::ovs': + bridge_mappings => %(CONFIG_QUANTUM_OVS_BRIDGE_MAPPINGS)s, }