← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~andreserl/maas/maas_fix_apache2_configs into lp:~maas-maintainers/maas/packaging

 

Andres Rodriguez has proposed merging lp:~andreserl/maas/maas_fix_apache2_configs into lp:~maas-maintainers/maas/packaging.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~andreserl/maas/maas_fix_apache2_configs/+merge/177464
-- 
https://code.launchpad.net/~andreserl/maas/maas_fix_apache2_configs/+merge/177464
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~andreserl/maas/maas_fix_apache2_configs into lp:~maas-maintainers/maas/packaging.
=== modified file 'debian/maas-cluster-controller.postinst'
--- debian/maas-cluster-controller.postinst	2013-07-18 14:14:21 +0000
+++ debian/maas-cluster-controller.postinst	2013-07-29 20:00:37 +0000
@@ -5,6 +5,8 @@
 . /usr/share/debconf/confmodule
 db_version 2.0
 
+RELEASE=`lsb_release -rs` || RELEASE=""
+
 create_log_dir() {
     # create log dir
     if [ ! -d /var/lib/maas ]; then
@@ -20,12 +22,12 @@
 }
 
 configure_maas_tgt(){
-	# Set up iSCSI: add maas.conf to tgt conf.d.
-	local tgtcfg="/etc/tgt/targets.conf"
-	[ -d /etc/tgt/conf.d/ ] || 
-	   echo "Warning! $tgtcfg did not exist" 1>&2;
-	mkdir -p /etc/tgt/conf.d/ /var/lib/maas/ephemeral/
-	ln -sf /var/lib/maas/ephemeral/tgt.conf /etc/tgt/conf.d/maas.conf
+    # Set up iSCSI: add maas.conf to tgt conf.d.
+    local tgtcfg="/etc/tgt/targets.conf"
+    [ -d /etc/tgt/conf.d/ ] || 
+        echo "Warning! $tgtcfg did not exist" 1>&2;
+    mkdir -p /etc/tgt/conf.d/ /var/lib/maas/ephemeral/
+    ln -sf /var/lib/maas/ephemeral/tgt.conf /etc/tgt/conf.d/maas.conf
 }
 
 extract_cluster_uuid(){
@@ -68,11 +70,21 @@
 }
 
 configure_cluster_http(){
-    # handle apache configs
-    if [ -e /etc/maas/maas-cluster-http.conf -a \
-        ! -e /etc/apache2/conf-enabled/maas-cluster-http.conf ]; then
-        ln -sf /etc/maas/maas-cluster-http.conf /etc/apache2/conf-enabled/maas-cluster-http.conf
-    fi
+    case $RELEASE in
+        12.04|12.10|13.04)
+            if [ -e /etc/maas/maas-cluster-http.conf -a \
+                ! -e /etc/apache2/conf.d/maas-cluster-http.conf ]; then
+                ln -sf /etc/maas/maas-cluster-http.conf /etc/apache2/conf.d/maas-cluster-http.conf
+            fi
+            ;;
+        *)
+            # handle apache configs
+            if [ -e /etc/maas/maas-cluster-http.conf -a \
+                ! -e /etc/apache2/conf-enabled/maas-cluster-http.conf ]; then
+                ln -sf /etc/maas/maas-cluster-http.conf /etc/apache2/conf-enabled/maas-cluster-http.conf
+            fi
+            ;;
+    esac
 }
 
 restart_apache2(){

=== modified file 'debian/maas-cluster-controller.postrm'
--- debian/maas-cluster-controller.postrm	2013-07-18 14:14:21 +0000
+++ debian/maas-cluster-controller.postrm	2013-07-29 20:00:37 +0000
@@ -4,14 +4,25 @@
 
 #DEBHELPER#
 
+RELEASE=`lsb_release -rs` || RELEASE=""
+
 case "$1" in
         purge)
 		# remove log directory
 		rm -rf /var/log/maas
-		# remove apache2 config
-		if [ -h /etc/apache2/conf-enabled/maas-cluster-http.conf ]; then
-			rm -rf /etc/apache2/conf-enabled/maas-cluster-http.conf
-		fi
+		case $RELEASE in
+			12.04|12.10|13.04)
+				if [ -h /etc/apache2/conf.d/maas-cluster-http.conf ]; then
+					rm -rf /etc/apache2/conf.d/maas-cluster-http.conf
+				fi
+				;;
+			*)
+				# remove apache2 config
+				if [ -h /etc/apache2/conf-enabled/maas-cluster-http.conf ]; then
+					rm -rf /etc/apache2/conf-enabled/maas-cluster-http.conf
+				fi
+				;;
+		esac
 		# remove var directory
 		rm -rf /var/lib/maas/celerybeat-cluster-schedule
 		DIR=/var/lib/maas

=== modified file 'debian/maas-region-controller.postinst'
--- debian/maas-region-controller.postinst	2013-07-18 14:14:21 +0000
+++ debian/maas-region-controller.postinst	2013-07-29 20:00:37 +0000
@@ -9,6 +9,8 @@
 	. /usr/share/dbconfig-common/dpkg/postinst.pgsql
 fi
 
+RELEASE=`lsb_release -rs` || RELEASE=""
+
 maas_sync_migrate_db(){
 	maas syncdb --noinput
 	maas migrate maasserver --noinput
@@ -127,12 +129,22 @@
 	#########################################################
 	################  Configure Apache2  ####################
 	#########################################################
-	# handle apache configs
-	if [ -e /etc/maas/maas-http.conf -a \
-		! -e /etc/apache2/conf-enabled/maas-http.conf ]; then
-		ln -sf /etc/maas/maas-http.conf /etc/apache2/conf-enabled/maas-http.conf
-	fi
-
+        case $RELEASE in
+		12.04|12.10|13.04)
+			# handle apache configs
+			if [ -e /etc/maas/maas-http.conf -a \
+				! -e /etc/apache2/conf.d/maas-http.conf ]; then
+				ln -sf /etc/maas/maas-http.conf /etc/apache2/conf.d/maas-http.conf
+			fi
+			;;
+		*)
+			# handle apache configs
+			if [ -e /etc/maas/maas-http.conf -a \
+				! -e /etc/apache2/conf-enabled/maas-http.conf ]; then
+				ln -sf /etc/maas/maas-http.conf /etc/apache2/conf-enabled/maas-http.conf
+			fi
+			;;
+	esac
 	# enable apache modules needed
 	a2enmod proxy_http
 	a2enmod expires

=== modified file 'debian/maas-region-controller.postrm'
--- debian/maas-region-controller.postrm	2013-07-18 14:14:21 +0000
+++ debian/maas-region-controller.postrm	2013-07-29 20:00:37 +0000
@@ -4,6 +4,8 @@
 
 . /usr/share/debconf/confmodule
 
+RELEASE=`lsb_release -rs` ||  RELEASE=""
+
 if [ -f /etc/dbconfig-common/maas.conf ]; then
 	if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
 		. /usr/share/dbconfig-common/dpkg/postrm.pgsql
@@ -15,9 +17,18 @@
 	purge)
 		rm -rf /var/log/maas
 		rm -rf /var/lib/maas
-		if [ -h /etc/apache2/conf-enabled/maas-http.conf ]; then
-			rm -rf /etc/apache2/conf-enabled/maas-http.conf
-		fi
+		case $RELEASE in
+			12.04|12.10|13.04)
+				if [ -h /etc/apache2/conf.d/maas-http.conf ]; then
+					rm -rf /etc/apache2/conf.d/maas-http.conf
+				fi
+				;;
+			*)
+				if [ -h /etc/apache2/conf-enabled/maas-http.conf ]; then
+					rm -rf /etc/apache2/conf-enabled/maas-http.conf
+				fi
+				;;
+		esac
 
 		# Restarting apache2
 		if [ -x /usr/sbin/invoke-rc.d ]; then