← Back to team overview

launchpad-reviewers team mailing list archive

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

 

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

Commit message:
Handle creation of user/group in maas-common.
debian/maas-region-controller.config: Always source dbconfig scripts.

Requested reviews:
  Andres Rodriguez (andreserl)
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~andreserl/maas/package_update_bzr1264/+merge/129280
-- 
https://code.launchpad.net/~andreserl/maas/package_update_bzr1264/+merge/129280
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~andreserl/maas/package_update_bzr1264 into lp:~maas-maintainers/maas/packaging.
=== modified file 'debian/changelog'
--- debian/changelog	2012-10-11 16:22:44 +0000
+++ debian/changelog	2012-10-11 18:54:20 +0000
@@ -1,4 +1,4 @@
-maas (0.1+bzr1263+dfsg-0ubuntu1) UNRELEASED; urgency=low
+maas (0.1+bzr1264+dfsg-0ubuntu1) UNRELEASED; urgency=low
 
   * New upstream release.
 
@@ -15,6 +15,8 @@
   * debian/control: Depends on maas-region-controller for maas-dns.
   * debian/maas-region-controller.postinst: Set the correct host for
     BROKER_URL (LP: #1065080)
+  * Handle creation of user/group in maas-common.
+  * debian/maas-region-controller.config: Always source dbconfig scripts.
 
  -- Andres Rodriguez <andreserl@xxxxxxxxxx>  Wed, 10 Oct 2012 11:17:21 -0400
 

=== modified file 'debian/maas-cluster-controller.postinst'
--- debian/maas-cluster-controller.postinst	2012-10-10 16:08:56 +0000
+++ debian/maas-cluster-controller.postinst	2012-10-11 18:54:20 +0000
@@ -3,21 +3,6 @@
 . /usr/share/debconf/confmodule
 db_version 2.0
 
-add_user_group(){
-    local user="maas"
-    local group="maas"
-    if ! getent group "$group" >/dev/null; then
-        addgroup --quiet --system "$group" || true
-    fi
-    if ! getent passwd "$user" > /dev/null 2>&1; then
-        adduser --quiet \
-                    --system \
-                    --group \
-                    --no-create-home \
-                    "$user" || true
-    fi
-}
-
 create_log_dir() {
     # create log dir
     if [ ! -d /var/lib/maas ]; then
@@ -33,8 +18,6 @@
 }
 
 if [ "$1" = "configure" ] && [ -z "$2" ]; then
-    add_user_group
-
     # logging
     create_log_dir
 

=== modified file 'debian/maas-cluster-controller.postrm'
--- debian/maas-cluster-controller.postrm	2012-10-10 16:08:56 +0000
+++ debian/maas-cluster-controller.postrm	2012-10-11 18:54:20 +0000
@@ -7,10 +7,6 @@
 
 case "$1" in
         purge)
-                # Deleting user/group
-                if getent passwd maas >/dev/null; then
-                        deluser maas || true
-                fi
                 # remove log directory
                 if [ -d /var/log/maas ]; then
                     rm -rf /var/log/maas

=== added file 'debian/maas-common.postinst'
--- debian/maas-common.postinst	1970-01-01 00:00:00 +0000
+++ debian/maas-common.postinst	2012-10-11 18:54:20 +0000
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+
+add_user_group(){
+	local user="maas"
+	local group="maas"
+	if ! getent group "$group" >/dev/null; then
+		addgroup --quiet --system "$group" || true
+	fi
+	if ! getent passwd "$user" > /dev/null 2>&1; then
+		adduser --quiet \
+		    --system \
+		    --group \
+		    --no-create-home \
+		    "$user" || true
+	fi
+}
+
+if [ "$1" = "configure" ]; then
+	add_user_group
+fi
+
+#DEBHELPER#

=== added file 'debian/maas-common.postrm'
--- debian/maas-common.postrm	1970-01-01 00:00:00 +0000
+++ debian/maas-common.postrm	2012-10-11 18:54:20 +0000
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+        purge)
+                # Deleting user/group
+                if getent passwd maas >/dev/null; then
+                        deluser maas || true
+                fi
+esac
+
+#DEBHELPER#

=== modified file 'debian/maas-dns.postinst'
--- debian/maas-dns.postinst	2012-10-03 01:46:42 +0000
+++ debian/maas-dns.postinst	2012-10-11 18:54:20 +0000
@@ -1,23 +1,6 @@
 #!/bin/sh -e
 
-add_user_group(){
-    local user="maas"
-    local group="maas"
-    if ! getent group "$group" >/dev/null; then
-        addgroup --quiet --system "$group" || true
-    fi
-    if ! getent passwd "$user" > /dev/null 2>&1; then
-        adduser --quiet \
-                    --system \
-                    --group \
-                    --no-create-home \
-                    "$user" || true
-    fi
-}
-
 if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
-    add_user_group
-
     # If /etc/bind/maas is empty, set_up_dns.
     if [ ! "$(ls -A /etc/bind/maas)" ]; then
         maas set_up_dns

=== modified file 'debian/maas-region-controller.config'
--- debian/maas-region-controller.config	2012-09-28 02:40:23 +0000
+++ debian/maas-region-controller.config	2012-10-11 18:54:20 +0000
@@ -16,22 +16,21 @@
 	fi
 }
 
+# source dbconfig-common shell library, and call the hook function
+if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
+	. /usr/share/dbconfig-common/dpkg/config.pgsql
+fi
 
 if ([ "$1" = "configure" ] && [ -z "$2" ]); then
 	# Hide maas/dbconfig-install question by setting default.
 	set_question maas-region-controller/dbconfig-install true
 	set_question maas-region-controller/pgsql/app-pass ""
 
-	# source dbconfig-common shell library, and call the hook function
-	if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
-		. /usr/share/dbconfig-common/dpkg/config.pgsql
-
-		dbc_dbname="maasdb"
-		dbc_dbuser="maas"
-		dbc_remove="true"
-
-		dbc_go maas-region-controller $@
-	fi
+	dbc_dbname="maasdb"
+	dbc_dbuser="maas"
+	dbc_remove="true"
+
+	dbc_go maas-region-controller $@
 
 elif [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
 	db_get maas/default-maas-url || true

=== modified file 'debian/maas-region-controller.postinst'
--- debian/maas-region-controller.postinst	2012-10-11 16:22:44 +0000
+++ debian/maas-region-controller.postinst	2012-10-11 18:54:20 +0000
@@ -45,21 +45,6 @@
 	fi
 }
 
-add_user_group(){
-	local user="maas"
-	local group="maas"
-	if ! getent group "$group" >/dev/null; then
-		addgroup --quiet --system "$group" || true
-	fi
-	if ! getent passwd "$user" > /dev/null 2>&1; then
-		adduser --quiet \
-                    --system \
-                    --group \
-                    --no-create-home \
-                    "$user" || true
-	fi
-}
-
 configure_maas_txlongpoll_rabbitmq_user() {
 	local longpoll_user="maas_longpoll"
 	local longpoll_pass=
@@ -151,11 +136,6 @@
 
 if [ "$1" = "configure" ] && [ -z "$2" ]; then
 	#########################################################
-	################ User/Group Creatiion  ##################
-	#########################################################
-	add_user_group
-
-	#########################################################
 	################ Folder Permissions  ####################
 	#########################################################
 	mkdir -p /var/lib/maas/media/storage

=== modified file 'debian/maas-region-controller.postrm'
--- debian/maas-region-controller.postrm	2012-10-05 04:26:58 +0000
+++ debian/maas-region-controller.postrm	2012-10-11 18:54:20 +0000
@@ -26,11 +26,6 @@
 			/etc/init.d/apache2 restart || true
 		fi
 
-		# Deleting user/group
-		if getent passwd maas >/dev/null; then
-			deluser maas || true
-		fi
-
 		# Delete symlink
 		if [ -L /etc/tgt/conf.d/maas.conf ]; then
 			rm -rf /etc/tgt/conf.d/maas.conf


Follow ups