-fi
-if @NEED_TO_RESTORE_NOVA@ ; then
- if [ -e /etc/nova/nova.conf ]; then
- if grep -q '^notification_driver=messaging$' /etc/nova/nova.conf; then
- sed -i -r 's/notification_driver=messaging/notification_driver=/g' /etc/nova/nova.conf
- service nova-api restart
- fi
- else
- echo "nova.conf file does not exist"
- exit 1
- fi
-fi
-exit 0
-END_TXT
- sed -i -e "s/@NEED_TO_RESTORE_CEILOMETER@/$NEED_TO_RESTORE_CEILOMETER/" restore_conf.sh
- sed -i -e "s/@NEED_TO_RESTORE_NOVA@/$NEED_TO_RESTORE_NOVA/" restore_conf.sh
- chmod +x restore_conf.sh
- for node in $CONTROLLER_IP;do
- scp $ssh_opts_cpu restore_conf.sh "root@$node:"
- ssh $ssh_opts_cpu "root@$node" './restore_conf.sh > restore_conf.log 2>&1 &'
- done
-
- echo "waiting service restart..."
- sleep 60
+
+ # TODO(r-mibu): fix the followings in upstream (fuel)
+ get_controller_ips
+ for node in $CONTROLLER_IPS;do
+ echo "restore controller configuration if touched ($node)"
+ ssh $ssh_opts_cpu "root@$node" '
+ set -x
+ echo "### revert patches (installer=fuel)"
+ date
+
+ # TODO(r-mibu): enable this section once congress 4.0.0 is available
+ if false; then
+ ha_conf=/etc/haproxy/conf.d/180-congress.cfg
+ if grep -q "# generated by doctor script" $ha_conf; then
+ rm -f $ha_conf
+ ip netns exec haproxy /usr/lib/ocf/resource.d/fuel/ns_haproxy restart
+ fi
+
+ rule="-m multiport -p tcp --dports 1789"
+ rule+=" -m comment --comment doctor-congress"
+ rule+=" -j ACCEPT"
+ if iptables -C INPUT $rule; then
+ iptables -D INPUT $rule
+ fi
+
+ co_conf=/etc/congress/congress.conf
+ entry="congress.datasources.doctor_driver.DoctorDriver"
+ if grep -q -e "^drivers.*$entry # added by doctor script" $co_conf; then
+ echo "modify the congress config"
+ sed -i -e "/^drivers/s/^\(.*\),$entry/\1/" $co_conf
+ service congress-server restart
+ fi
+ fi
+
+ ep_conf=/etc/ceilometer/event_pipeline.yaml
+ if grep -q "# added by doctor script" $ep_conf; then
+ sed -ie "/# added by doctor script/d" $ep_conf
+ service ceilometer-agent-notification restart
+ fi
+ ' >> installer_apply_patches_$node.log 2>&1
+ done