From 04a511a1a828a829962681525780f80935a161f9 Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Tue, 2 Apr 2013 23:29:24 -0600 Subject: [PATCH] CLOUDSTACK-1900 : Save a default db.properties during upgrade, and make sure we only pull the old configs once. Signed-off-by: Marcus Sorensen 1364966964 -0600 --- packaging/centos63/cloud.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec index 7d6e63880b1..5baf58f9fb5 100644 --- a/packaging/centos63/cloud.spec +++ b/packaging/centos63/cloud.spec @@ -363,9 +363,12 @@ if getent passwd cloud | grep -q /var/lib/cloud; then fi # if saved configs from upgrade exist, copy them over -if [ -d "%{_sysconfdir}/cloud.rpmsave/management" ]; then +if [ -f "%{_sysconfdir}/cloud.rpmsave/management/db.properties" ]; then + mv %{_sysconfdir}/%{name}/management/db.properties %{_sysconfdir}/%{name}/management/db.properties.rpmnew cp -p %{_sysconfdir}/cloud.rpmsave/management/db.properties %{_sysconfdir}/%{name}/management cp -p %{_sysconfdir}/cloud.rpmsave/management/key %{_sysconfdir}/%{name}/management + # make sure we only do this on the first install of this RPM, don't want to overwrite on a reinstall + mv %{_sysconfdir}/cloud.rpmsave/management/db.properties %{_sysconfdir}/cloud.rpmsave/management/db.properties.rpmsave fi # Choose server.xml and tomcat.conf links based on old config, if exists @@ -407,6 +410,8 @@ fi if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then mv %{_sysconfdir}/%{name}/agent/agent.properties %{_sysconfdir}/%{name}/agent/agent.properties.rpmnew cp -p %{_sysconfdir}/cloud.rpmsave/agent/agent.properties %{_sysconfdir}/%{name}/agent + # make sure we only do this on the first install of this RPM, don't want to overwrite on a reinstall + mv %{_sysconfdir}/cloud.rpmsave/agent/agent.properties %{_sysconfdir}/cloud.rpmsave/agent/agent.properties.rpmsave fi #%post awsapi