+function installer_apply_patches {
+ # TODO(r-mibu): fix the followings in upstream (apex)
+ for node in $CONTROLLER_IPS;do
+ echo "check controller configuration for doctor ($node)"
+ ssh $ssh_opts_cpu "heat-admin@$node" '
+ set -x
+ date
+ echo "### apply patches (installer=apex)"
+
+ ep_conf=/etc/ceilometer/event_pipeline.yaml
+ ep_entry="- notifier://?topic=alarm.all"
+ if sudo grep -e "$ep_entry" $ep_conf; then
+ echo "NOTE: ceilometer is configured as we needed"
+ else
+ echo "modify the ceilometer config"
+ sudo sed -i -e "$ a \ \ \ \ \ \ \ \ \ \ $ep_entry # added by doctor script" $ep_conf
+ sudo systemctl restart openstack-ceilometer-notification.service
+ fi
+
+ co_conf=/etc/congress/congress.conf
+ co_conf_bak=/etc/congress/congress.conf.bak
+ co_entry="congress.datasources.doctor_driver.DoctorDriver"
+ if sudo grep -e "^drivers.*$co_entry" $co_conf; then
+ echo "NOTE: congress is configured as we needed"
+ else
+ echo "modify the congress config"
+ sudo cp $co_conf $co_conf_bak
+ sudo sed -i -e "/^drivers/s/$/,$co_entry/" $co_conf
+ sudo systemctl restart openstack-congress-server.service
+ fi
+ ' > installer_apply_patches_$node.log 2>&1
+ done
+}
+