Be explicit when copying files to /etc/ceilometer

If we use a glob too many files are attempted to be copied and we can
cause two issues:

* there can be a permission problem because an earlier call to
  configure_rootwrap already wrote some files as root
* iniset calls on ceilometer.conf that already happened will be
  clobbered

Change-Id: I960256cdd2c32bbbe4591282e8a56ee156541667
Closes-Bug: #1503338
This commit is contained in:
Chris Dent 2015-10-09 13:12:29 +00:00
parent 6fe1319f66
commit 614d7422d5
1 changed files with 13 additions and 2 deletions

View File

@ -235,6 +235,8 @@ function _ceilometer_configure_storage_backend {
# Configure Ceilometer
function configure_ceilometer {
local conffile
iniset_rpc_backend ceilometer $CEILOMETER_CONF
iniset $CEILOMETER_CONF DEFAULT notification_topics "$CEILOMETER_NOTIFICATION_TOPICS"
@ -246,8 +248,17 @@ function configure_ceilometer {
iniset $CEILOMETER_CONF compute workload_partitioning True
fi
# Install the policy file for the API server
cp -a $CEILOMETER_DIR/etc/ceilometer/* $CEILOMETER_CONF_DIR
# Install the policy file and declarative configuration files to
# the conf dir.
# NOTE(cdent): Do not make this a glob as it will conflict
# with rootwrap installation done elsewhere and also clobber
# ceilometer.conf settings that have already been made.
# Anyway, explicit is better than implicit.
for conffile in policy.json api_paste.ini pipeline.yaml \
event_definitions.yaml event_pipeline.yaml \
gnocchi_resources.yaml; do
cp $CEILOMETER_DIR/etc/ceilometer/$conffile $CEILOMETER_CONF_DIR
done
iniset $CEILOMETER_CONF oslo_policy policy_file $CEILOMETER_CONF_DIR/policy.json
if [ "$CEILOMETER_PIPELINE_INTERVAL" ]; then