summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-neutron_git.bb
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2014-04-22 21:22:25 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-04-23 23:36:03 -0400
commit0ae7fe2223c6aca2e6ab0a71946ef59a2de2472c (patch)
tree8d9e89b79f4c2d4765ef9ebeeed454210686227e /meta-openstack/recipes-devtools/python/python-neutron_git.bb
parent21fd86369df53482e53e8440e3d5f520d305736a (diff)
downloadmeta-cloud-services-0ae7fe2223c6aca2e6ab0a71946ef59a2de2472c.tar.gz
cleanup: leave source config files pristine
Editing the files in ${WORKDIR} using sed or similar tools as part of do_install means they can only be edited once. Supplying a modified CONTROLLER_IP in local.conf and building the image again will not result in the CONTROLLER_IP being properly updated since the substitution placeholders will no longer exist. We therefore simply swap the other of things, installing the configuration files first, then editing them to swap the placeholders. This means we can run the do_install again and again and get the results we expect. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-neutron_git.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-neutron_git.bb38
1 files changed, 19 insertions, 19 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-neutron_git.bb b/meta-openstack/recipes-devtools/python/python-neutron_git.bb
index 9b291df..9bba8f2 100644
--- a/meta-openstack/recipes-devtools/python/python-neutron_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-neutron_git.bb
@@ -27,34 +27,34 @@ do_install_append() {
27 TEMPLATE_CONF_DIR=${S}${sysconfdir}/ 27 TEMPLATE_CONF_DIR=${S}${sysconfdir}/
28 NEUTRON_CONF_DIR=${D}${sysconfdir}/neutron 28 NEUTRON_CONF_DIR=${D}${sysconfdir}/neutron
29 29
30 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
31 ${TEMPLATE_CONF_DIR}/neutron.conf > ${WORKDIR}/neutron.conf
32 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/neutron.conf
33 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
34 -i ${WORKDIR}/neutron.conf
35 sed -e "s:^# core_plugin.*:core_plugin = neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2:g" \
36 -i ${WORKDIR}/neutron.conf
37
38 sed -e "s:^# rabbit_host =.*:rabbit_host = ${CONTROLLER_IP}:" -i ${WORKDIR}/neutron.conf
39
40 for file in ovs_neutron_plugin.ini linuxbridge_conf.ini
41 do
42 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/${file}
43 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/${file}
44 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/${file}
45 sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${WORKDIR}/${file}
46 done
47
48 install -d ${NEUTRON_CONF_DIR} 30 install -d ${NEUTRON_CONF_DIR}
49 install -d ${NEUTRON_CONF_DIR}/plugins/openvswitch 31 install -d ${NEUTRON_CONF_DIR}/plugins/openvswitch
50 install -d ${NEUTRON_CONF_DIR}/plugins/linuxbridge 32 install -d ${NEUTRON_CONF_DIR}/plugins/linuxbridge
51 33
52 install -m 600 ${WORKDIR}/neutron.conf ${NEUTRON_CONF_DIR}/ 34 install -m 600 ${TEMPLATE_CONF_DIR}/neutron.conf ${NEUTRON_CONF_DIR}/
53 install -m 600 ${WORKDIR}/ovs_neutron_plugin.ini ${NEUTRON_CONF_DIR}/plugins/openvswitch/ 35 install -m 600 ${WORKDIR}/ovs_neutron_plugin.ini ${NEUTRON_CONF_DIR}/plugins/openvswitch/
54 install -m 600 ${WORKDIR}/linuxbridge_conf.ini ${NEUTRON_CONF_DIR}/plugins/linuxbridge/ 36 install -m 600 ${WORKDIR}/linuxbridge_conf.ini ${NEUTRON_CONF_DIR}/plugins/linuxbridge/
55 install -m 600 ${S}/etc/api-paste.ini ${NEUTRON_CONF_DIR}/ 37 install -m 600 ${S}/etc/api-paste.ini ${NEUTRON_CONF_DIR}/
56 install -m 600 ${S}/etc/policy.json ${NEUTRON_CONF_DIR}/ 38 install -m 600 ${S}/etc/policy.json ${NEUTRON_CONF_DIR}/
57 39
40 sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \
41 -i ${NEUTRON_CONF_DIR}/neutron.conf
42 sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${NEUTRON_CONF_DIR}/neutron.conf
43 sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \
44 -i ${NEUTRON_CONF_DIR}/neutron.conf
45 sed -e "s:^# core_plugin.*:core_plugin = neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2:g" \
46 -i ${NEUTRON_CONF_DIR}/neutron.conf
47
48 sed -e "s:^# rabbit_host =.*:rabbit_host = ${CONTROLLER_IP}:" -i ${NEUTRON_CONF_DIR}/neutron.conf
49
50 for file in plugins/openvswitch/ovs_neutron_plugin.ini plugins/linuxbridge/linuxbridge_conf.ini
51 do
52 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${NEUTRON_CONF_DIR}/${file}
53 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${NEUTRON_CONF_DIR}/${file}
54 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${NEUTRON_CONF_DIR}/${file}
55 sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${NEUTRON_CONF_DIR}/${file}
56 done
57
58 PLUGIN=openvswitch 58 PLUGIN=openvswitch
59 ARGS="--config-file=${sysconfdir}/${SRCNAME}/neutron.conf --config-file=${sysconfdir}/${SRCNAME}/plugins/openvswitch/ovs_neutron_plugin.ini" 59 ARGS="--config-file=${sysconfdir}/${SRCNAME}/neutron.conf --config-file=${sysconfdir}/${SRCNAME}/plugins/openvswitch/ovs_neutron_plugin.ini"
60 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then 60 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then