cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/3] git commit: updated refs/heads/master to 12e698d
Date Tue, 30 Aug 2016 13:03:13 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master fcc8dcd5d -> 12e698de5


Fix a little issue from PR1610 if the db.properties file hasn't EOL character at the end of
file
And some improvements about the dir/file using variables


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6051fa50
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6051fa50
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6051fa50

Branch: refs/heads/master
Commit: 6051fa503a2da7b96256f21e6b7c42aa1f3cb01e
Parents: 227ff38
Author: Milamber <milamber@apache.org>
Authored: Tue Aug 2 09:00:21 2016 +0100
Committer: Milamber <milamber@apache.org>
Committed: Tue Aug 30 08:29:06 2016 +0100

----------------------------------------------------------------------
 debian/cloudstack-management.postinst | 13 ++++++++-----
 packaging/centos63/cloud.spec         |  6 +++---
 packaging/centos7/cloud.spec          |  6 +++---
 3 files changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6051fa50/debian/cloudstack-management.postinst
----------------------------------------------------------------------
diff --git a/debian/cloudstack-management.postinst b/debian/cloudstack-management.postinst
index e37813f..e70a1a4 100644
--- a/debian/cloudstack-management.postinst
+++ b/debian/cloudstack-management.postinst
@@ -55,14 +55,17 @@ if [ "$1" = configure ]; then
         fi
     fi
 
-    chmod 0640 /etc/cloudstack/management/db.properties
-    chgrp cloud /etc/cloudstack/management/db.properties
+    CONFDIR="/etc/cloudstack/management"
+    DBPROPS="db.properties"
+
+    chmod 0640 ${CONFDIR}/${DBPROPS}
+    chgrp cloud ${CONFDIR}/${DBPROPS}
     invoke-rc.d tomcat6 stop || true
 
     # Add jdbc MySQL driver settings to db.properties if not present
-    grep "db.cloud.driver=jdbc:mysql" /etc/cloudstack/management/db.properties > /dev/null||
echo "db.cloud.driver=jdbc:mysql" >> /etc/cloudstack/management/db.properties
-    grep "db.usage.driver=jdbc:mysql" /etc/cloudstack/management/db.properties > /dev/null||
echo "db.usage.driver=jdbc:mysql" >> /etc/cloudstack/management/db.properties
-    grep "db.simulator.driver=jdbc:mysql" /etc/cloudstack/management/db.properties > /dev/null||
echo "db.simulator.driver=jdbc:mysql" >> /etc/cloudstack/management/db.properties
+    grep -s -q "db.cloud.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS} || sed -i -e "\$adb.cloud.driver=jdbc:mysql"
${CONFDIR}/${DBPROPS}
+    grep -s -q "db.usage.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS} || sed -i -e "\$adb.usage.driver=jdbc:mysql"
${CONFDIR}/${DBPROPS}
+    grep -s -q "db.simulator.driver=jdbc:mysql" ${CONFDIR}/${DBPROPS} || sed -i -e "\$adb.simulator.driver=jdbc:mysql"
${CONFDIR}/${DBPROPS}
 fi
 
 #DEBHELPER#

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6051fa50/packaging/centos63/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec
index 2858395..1c94a08 100644
--- a/packaging/centos63/cloud.spec
+++ b/packaging/centos63/cloud.spec
@@ -408,9 +408,9 @@ if [ "$1" == "1" ] ; then
     /sbin/chkconfig --level 345 cloudstack-management on > /dev/null 2>&1 || true
 fi
 
-grep "db.cloud.driver=jdbc:mysql" /etc/cloudstack/management/db.properties > /dev/null||
echo "db.cloud.driver=jdbc:mysql" >> /etc/cloudstack/management/db.properties
-grep "db.usage.driver=jdbc:mysql" /etc/cloudstack/management/db.properties > /dev/null||
echo "db.usage.driver=jdbc:mysql" >> /etc/cloudstack/management/db.properties
-grep "db.simulator.driver=jdbc:mysql" /etc/cloudstack/management/db.properties > /dev/null||
echo "db.simulator.driver=jdbc:mysql" >> /etc/cloudstack/management/db.properties
+grep -s -q "db.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|| sed -i -e "\$adb.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
+grep -s -q "db.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|| sed -i -e "\$adb.usage.driver=jdbc:mysql" db.properties
+grep -s -q "db.simulator.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|| sed -i -e "\$adb.simulator.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
 
 if [ ! -f %{_datadir}/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util ] ; then
     echo Please download vhd-util from http://download.cloud.com.s3.amazonaws.com/tools/vhd-util
and put it in 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6051fa50/packaging/centos7/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos7/cloud.spec b/packaging/centos7/cloud.spec
index 8d2ddc4..451fa8f 100644
--- a/packaging/centos7/cloud.spec
+++ b/packaging/centos7/cloud.spec
@@ -363,9 +363,9 @@ if [ "$1" == "1" ] ; then
     /usr/bin/systemctl on cloudstack-management > /dev/null 2>&1 || true
 fi
 
-grep "db.cloud.driver=jdbc:mysql" /etc/cloudstack/management/db.properties > /dev/null||
echo "db.cloud.driver=jdbc:mysql" >> /etc/cloudstack/management/db.properties
-grep "db.usage.driver=jdbc:mysql" /etc/cloudstack/management/db.properties > /dev/null||
echo "db.usage.driver=jdbc:mysql" >> /etc/cloudstack/management/db.properties
-grep "db.simulator.driver=jdbc:mysql" /etc/cloudstack/management/db.properties > /dev/null||
echo "db.simulator.driver=jdbc:mysql" >> /etc/cloudstack/management/db.properties
+grep -s -q "db.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|| sed -i -e "\$adb.cloud.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
+grep -s -q "db.usage.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|| sed -i -e "\$adb.usage.driver=jdbc:mysql" db.properties
+grep -s -q "db.simulator.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
|| sed -i -e "\$adb.simulator.driver=jdbc:mysql" "%{_sysconfdir}/%{name}/management/db.properties"
 
 if [ ! -f %{_datadir}/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util ] ; then
     echo Please download vhd-util from http://download.cloud.com.s3.amazonaws.com/tools/vhd-util
and put it in


Mime
View raw message