From 0ae7fe2223c6aca2e6ab0a71946ef59a2de2472c Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Tue, 22 Apr 2014 21:22:25 -0400 Subject: 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 Signed-off-by: Bruce Ashfield --- .../python/python-ceilometer_git.bb | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'meta-openstack/recipes-devtools/python/python-ceilometer_git.bb') diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb index 7ee4e44..a58d218 100644 --- a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb +++ b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb @@ -30,24 +30,24 @@ do_install_append() { TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME} CEILOMETER_CONF_DIR=${D}${sysconfdir}/${SRCNAME} - sed -e "s:%CEILOMETER_SECRET%:${CEILOMETER_SECRET}:g" -i ${WORKDIR}/ceilometer.conf + install -d ${CEILOMETER_CONF_DIR} + install -m 600 ${WORKDIR}/ceilometer.conf ${CEILOMETER_CONF_DIR} + install -m 600 ${TEMPLATE_CONF_DIR}/*.json ${CEILOMETER_CONF_DIR} + install -m 600 ${TEMPLATE_CONF_DIR}/*.yaml ${CEILOMETER_CONF_DIR} - sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/ceilometer.conf - sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/ceilometer.conf + sed -e "s:%CEILOMETER_SECRET%:${CEILOMETER_SECRET}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf - sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/ceilometer.conf - sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${WORKDIR}/ceilometer.conf + sed -e "s:%DB_USER%:${DB_USER}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf + sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf - sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${WORKDIR}/ceilometer.conf - sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${WORKDIR}/ceilometer.conf + sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf + sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf - sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${WORKDIR}/ceilometer.conf - sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${WORKDIR}/ceilometer.conf + sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf + sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf - install -d ${CEILOMETER_CONF_DIR} - install -m 600 ${WORKDIR}/ceilometer.conf ${CEILOMETER_CONF_DIR} - install -m 600 ${TEMPLATE_CONF_DIR}/*.json ${CEILOMETER_CONF_DIR} - install -m 600 ${TEMPLATE_CONF_DIR}/*.yaml ${CEILOMETER_CONF_DIR} + sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf + sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" -i ${CEILOMETER_CONF_DIR}/ceilometer.conf if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then install -d ${D}${sysconfdir}/init.d -- cgit v1.2.3-54-g00ecf