cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [2/3] git commit: updated refs/heads/master to ee639cf
Date Tue, 10 Nov 2015 12:31:38 GMT
CLOUDSTACK-9049: fix Centos7 with Tomcat7 packaging and python libs
* adjust library to support tomcat7 config files
* adjust centos7 spec to use tomcat7 config files from deployment
* add option to use tomcat7 files in management server setup


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

Branch: refs/heads/master
Commit: 3c4a24cf2c34fcc94114863c5f45e755625a613d
Parents: c84bb6b
Author: David Amorim Faria <d.amorim-faria@tech.leaseweb.com>
Authored: Mon Nov 9 18:15:37 2015 +0100
Committer: David Amorim Faria <d.amorim-faria@tech.leaseweb.com>
Committed: Tue Nov 10 11:55:19 2015 +0100

----------------------------------------------------------------------
 client/bindir/cloud-setup-management.in      |  3 ++
 packaging/centos7/cloud.spec                 | 17 ++++---
 python/lib/cloudutils/globalEnv.py           |  2 +
 python/lib/cloudutils/serviceConfigServer.py | 54 +++++++++++++++--------
 4 files changed, 50 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c4a24cf/client/bindir/cloud-setup-management.in
----------------------------------------------------------------------
diff --git a/client/bindir/cloud-setup-management.in b/client/bindir/cloud-setup-management.in
index aa9a46b..4d742e9 100755
--- a/client/bindir/cloud-setup-management.in
+++ b/client/bindir/cloud-setup-management.in
@@ -29,9 +29,12 @@ if __name__ == '__main__':
     
     parser = OptionParser()
     parser.add_option("--https", action="store_true", dest="https", help="Enable HTTPs connection
of management server")
+    parser.add_option("--tomcat7", action="store_true", dest="tomcat7", help="Use Tomcat7
configuration files in Management Server")
     (options, args) = parser.parse_args()
     if options.https:
         glbEnv.svrMode = "HttpsServer"
+    if options.tomcat7:
+        glbEnv.svrConf = "Tomcat7"
 
     glbEnv.mode = "Server"
     

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c4a24cf/packaging/centos7/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos7/cloud.spec b/packaging/centos7/cloud.spec
index 5f9f113..e94ef65 100644
--- a/packaging/centos7/cloud.spec
+++ b/packaging/centos7/cloud.spec
@@ -249,16 +249,16 @@ cp -r client/target/cloud-client-ui-%{_maventag}/* ${RPM_BUILD_ROOT}%{_datadir}/
 rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/scripts
 rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/vms
 
-for name in catalina.properties db.properties log4j-cloud.xml web.xml \
-            server.xml commons-logging.properties environment.properties java.security.ciphers
tomcat-users.xml
+for name in db.properties log4j-cloud.xml server7-nonssl.xml server7-ssl.xml \
+            commons-logging.properties catalina.policy catalina.properties classpath.conf
\
+            tomcat-users.xml web.xml environment.properties java.security.ciphers
 do
-  cp packaging/centos7/tomcat7/$name \
+  mv ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/$name
\
     ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/$name
-  rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/$name
 done
 
-#ln -s %{_sysconfdir}/%{name}/management/log4j-cloud.xml \
-#    ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/log4j-cloud.xml
+ln -s %{_sysconfdir}/%{name}/management/log4j-cloud.xml \
+    ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/log4j-cloud.xml
 
 mv ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/context.xml
\
     ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost/client
@@ -438,10 +438,13 @@ fi
 %config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/db.properties
 %config(noreplace) %{_sysconfdir}/%{name}/management/log4j-cloud.xml
 %config(noreplace) %{_sysconfdir}/%{name}/management/Catalina/localhost/client/context.xml
+%config(noreplace) %{_sysconfdir}/%{name}/management/catalina.policy
 %config(noreplace) %{_sysconfdir}/%{name}/management/catalina.properties
+%config(noreplace) %{_sysconfdir}/%{name}/management/classpath.conf
+%config(noreplace) %{_sysconfdir}/%{name}/management/server7-nonssl.xml
+%config(noreplace) %{_sysconfdir}/%{name}/management/server7-ssl.xml
 %config(noreplace) %{_sysconfdir}/%{name}/management/tomcat-users.xml
 %config(noreplace) %{_sysconfdir}/%{name}/management/web.xml
-%config(noreplace) %{_sysconfdir}/%{name}/management/server.xml
 %config(noreplace) %{_sysconfdir}/%{name}/management/environment.properties
 %config(noreplace) %{_sysconfdir}/%{name}/management/java.security.ciphers
 %config(noreplace) %{_sysconfdir}/%{name}/management/commons-logging.properties

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c4a24cf/python/lib/cloudutils/globalEnv.py
----------------------------------------------------------------------
diff --git a/python/lib/cloudutils/globalEnv.py b/python/lib/cloudutils/globalEnv.py
index 1f6083c..106e3bb 100644
--- a/python/lib/cloudutils/globalEnv.py
+++ b/python/lib/cloudutils/globalEnv.py
@@ -22,6 +22,8 @@ class globalEnv:
         self.svrMode = None
         #myCloud/Agent/Console
         self.agentMode = None
+        #Tomcat6/Tomcat7
+        self.svrConf = None
         #debug
         self.debug = False
         #management server IP

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c4a24cf/python/lib/cloudutils/serviceConfigServer.py
----------------------------------------------------------------------
diff --git a/python/lib/cloudutils/serviceConfigServer.py b/python/lib/cloudutils/serviceConfigServer.py
index b928df4..56e09a2 100644
--- a/python/lib/cloudutils/serviceConfigServer.py
+++ b/python/lib/cloudutils/serviceConfigServer.py
@@ -79,30 +79,43 @@ class cloudManagementConfig(serviceCfgBase):
                
                 if not cmd.isSuccess():
                     raise CloudInternalException(cmd.getErrMsg())
-            
+            if not self.syscfg.env.svrConf == "Tomcat7":
                 cfo = configFileOps("/etc/cloudstack/management/tomcat6.conf", self)
                 cfo.add_lines("JAVA_OPTS+=\" -Djavax.net.ssl.trustStore=%s \""%keyPath)
         elif self.syscfg.env.svrMode == "HttpsServer":
-            if not os.path.exists("/etc/cloudstack/management/server-ssl.xml") or not os.path.exists("/etc/cloudstack/management/tomcat6-ssl.conf"):
-                raise CloudRuntimeException("Cannot find /etc/cloudstack/management/server-ssl.xml
or /etc/cloudstack/management/tomcat6-ssl.conf, https enables failed")
-            if os.path.exists("/etc/cloudstack/management/server.xml"):
-                bash("rm -f /etc/cloudstack/management/server.xml")
-            if os.path.exists("/etc/cloudstack/management/tomcat6.conf"):
-                bash("rm -f /etc/cloudstack/management/tomcat6.conf")
-            bash("ln -s /etc/cloudstack/management/server-ssl.xml /etc/cloudstack/management/server.xml")
-            bash("ln -s /etc/cloudstack/management/tomcat6-ssl.conf /etc/cloudstack/management/tomcat6.conf")
+            if self.syscfg.env.svrConf == "Tomcat7":
+                if not os.path.exists("/etc/cloudstack/management/server7-ssl.xml"):
+                    raise CloudRuntimeException("Cannot find /etc/cloudstack/management/server7-ssl.xml,
https enable failed")
+                if os.path.exists("/etc/cloudstack/management/server.xml"):
+                    bash("rm -f /etc/cloudstack/management/server.xml")
+                bash("ln -s /etc/cloudstack/management/server7-ssl.xml /etc/cloudstack/management/server.xml")
+            else:
+                if not os.path.exists("/etc/cloudstack/management/server-ssl.xml") or not
os.path.exists("/etc/cloudstack/management/tomcat6-ssl.conf"):
+                    raise CloudRuntimeException("Cannot find /etc/cloudstack/management/server-ssl.xml
or /etc/cloudstack/management/tomcat6-ssl.conf, https enable failed")
+                if os.path.exists("/etc/cloudstack/management/server.xml"):
+                    bash("rm -f /etc/cloudstack/management/server.xml")
+                if os.path.exists("/etc/cloudstack/management/tomcat6.conf"):
+                    bash("rm -f /etc/cloudstack/management/tomcat6.conf")
+                bash("ln -s /etc/cloudstack/management/server-ssl.xml /etc/cloudstack/management/server.xml")
+                bash("ln -s /etc/cloudstack/management/tomcat6-ssl.conf /etc/cloudstack/management/tomcat6.conf")
             if not bash("iptables-save |grep PREROUTING | grep 6443").isSuccess():
                 bash("iptables -A PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-port
6443")
         else:
-            if not os.path.exists("/etc/cloudstack/management/server-nonssl.xml") or not
os.path.exists("/etc/cloudstack/management/tomcat6-nonssl.conf"):
-                raise CloudRuntimeException("Cannot find /etc/cloudstack/management/server-nonssl.xml
or /etc/cloudstack/management/tomcat6-nonssl.conf, https enables failed")
-            if os.path.exists("/etc/cloudstack/management/server.xml"):
-                bash("rm -f /etc/cloudstack/management/server.xml")
-            if os.path.exists("/etc/cloudstack/management/tomcat6.conf"):
-                bash("rm -f /etc/cloudstack/management/tomcat6.conf")
-            bash("ln -s /etc/cloudstack/management/server-nonssl.xml /etc/cloudstack/management/server.xml")
-            bash("ln -s /etc/cloudstack/management/tomcat6-nonssl.conf /etc/cloudstack/management/tomcat6.conf")
-
+            if self.syscfg.env.svrConf == "Tomcat7":
+                if not os.path.exists("/etc/cloudstack/management/server7-nonssl.xml"):
+                    raise CloudRuntimeException("Cannot find /etc/cloudstack/management/server7-nonssl.xml,
https enable failed")
+                if os.path.exists("/etc/cloudstack/management/server.xml"):
+                    bash("rm -f /etc/cloudstack/management/server.xml")
+                bash("ln -s /etc/cloudstack/management/server7-nonssl.xml /etc/cloudstack/management/server.xml")
+            else:
+                if not os.path.exists("/etc/cloudstack/management/server-nonssl.xml") or
not os.path.exists("/etc/cloudstack/management/tomcat6-nonssl.conf"):
+                    raise CloudRuntimeException("Cannot find /etc/cloudstack/management/server-nonssl.xml
or /etc/cloudstack/management/tomcat6-nonssl.conf, https enable failed")
+                if os.path.exists("/etc/cloudstack/management/server.xml"):
+                    bash("rm -f /etc/cloudstack/management/server.xml")
+                if os.path.exists("/etc/cloudstack/management/tomcat6.conf"):
+                    bash("rm -f /etc/cloudstack/management/tomcat6.conf")
+                bash("ln -s /etc/cloudstack/management/server-nonssl.xml /etc/cloudstack/management/server.xml")
+                bash("ln -s /etc/cloudstack/management/tomcat6-nonssl.conf /etc/cloudstack/management/tomcat6.conf")
         bash("touch /var/run/cloudstack-management.pid")
         bash("chown cloud.cloud /var/run/cloudstack-management.pid")
         #distro like sl 6.1 needs this folder, or tomcat6 failed to start
@@ -116,7 +129,10 @@ class cloudManagementConfig(serviceCfgBase):
             cfo.save()
         
         try:
-            self.syscfg.svo.disableService("tomcat6")
+            if self.syscfg.env.svrConf == "Tomcat7":
+                self.syscfg.svo.disableService("tomcat")
+            else:
+                self.syscfg.svo.disableService("tomcat6")
         except:
             pass
             


Mime
View raw message