← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/maas/pkg-move-import-script into lp:~maas-maintainers/maas/packaging

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/maas/pkg-move-import-script into lp:~maas-maintainers/maas/packaging.

Commit message:
Move the import scripts from the region-controller package to the cluster-controller package.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jtv/maas/pkg-move-import-script/+merge/133101

Discussed with Raphaël.  The obvious change is simply to move installation of the scripts from the one package to the other, but manual testing showed that the postinst/postrm for the region controller also handled configuration for tgtd.  This is no longer needed on the region controller, but it is now needed on the cluster controller.  The maas-import-ephemerals installs ephemeral images into the iSCSI tree managed by tgtd.

Another thing that came up is that maas-provision complains about not finding celeryconfig.py, a configuration module that we only use on the region controller.  In a separate branch I'll make the import script select cluster_celeryconfig.py instead.

With that change, in addition to the diff you see on this MP, the import completed successfully.  I tried it on a cloud instance without any region controller installed, and then on the same instance, I also tried installing a region controller and re-running the import.


Jeroen
-- 
https://code.launchpad.net/~jtv/maas/pkg-move-import-script/+merge/133101
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/maas/pkg-move-import-script into lp:~maas-maintainers/maas/packaging.
=== modified file 'debian/changelog'
--- debian/changelog	2012-10-29 14:18:01 +0000
+++ debian/changelog	2012-11-06 16:50:25 +0000
@@ -11,6 +11,16 @@
     is no longer required as upstream no longer stores files in the filesystem.
     (LP: #1069734)
 
+  [ Jeroen Vermeulen ]
+  * debian/maas-cluster-controller.install: Install import scripts.
+  * debian/maas-cluster-controller.postinst: Configure tgt (the iSCSI server)
+    so the import script can install files to it.
+  * debian/maas-cluster-controller.postrm: Clean up tgt config.
+  * debian/maas-region-controller.install: Move import scripts out to the
+    cluster controller, and drop the maas-import-isos compatibility script.
+  * debian/maas-region-controller.postinst: Remove tgt config.
+  * debian/maas-region-controller.postrm: Remove tgt config cleanup.
+
  -- Julian Edwards <julian.edwards@xxxxxxxxxxxxx>  Fri, 26 Oct 2012 12:50:20 +0200
 
 maas (0.1+bzr1269+dfsg-0ubuntu1) quantal-proposed; urgency=low

=== modified file 'debian/maas-cluster-controller.install'
--- debian/maas-cluster-controller.install	2012-10-10 19:06:52 +0000
+++ debian/maas-cluster-controller.install	2012-11-06 16:50:25 +0000
@@ -13,6 +13,17 @@
 # Install local celery cluster config file
 debian/tmp/etc/maas/maas_local_celeryconfig_cluster.py
 
+# Install maas-import-pxe-files and related files
+debian/tmp/usr/sbin/maas-import-pxe-files
+etc/cron.d/maas-import-pxe-files
+man/maas-import-pxe-files.8 usr/share/man/man8
+debian/tmp/etc/maas/import_pxe_files
+debian/tmp/usr/sbin/maas-import-squashfs
+debian/tmp/etc/maas/import_squashfs
+debian/tmp/usr/sbin/maas-import-ephemerals
+debian/tmp/etc/maas/import_ephemerals
+debian/tmp/etc/maas/commissioning-user-data
+
 # Install all other stuff
 debian/extras/99-maas-sudoers etc/sudoers.d
 debian/extras/isc-dhcp-server.override etc/init

=== modified file 'debian/maas-cluster-controller.postinst'
--- debian/maas-cluster-controller.postinst	2012-10-11 18:16:28 +0000
+++ debian/maas-cluster-controller.postinst	2012-11-06 16:50:25 +0000
@@ -17,6 +17,15 @@
     chmod -R 775 /var/log/maas/oops
 }
 
+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
+}
+
 if [ "$1" = "configure" ] && [ -z "$2" ]; then
     # logging
     create_log_dir
@@ -32,6 +41,8 @@
         sed -i "s|^CLUSTER_UUID\ \= None$|CLUSTER_UUID = '"$uuid"'|" \
                        /etc/maas/maas_local_celeryconfig_cluster.py
     fi
+
+    configure_maas_tgt
 fi
 
 if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then

=== modified file 'debian/maas-cluster-controller.postrm'
--- debian/maas-cluster-controller.postrm	2012-10-11 18:16:28 +0000
+++ debian/maas-cluster-controller.postrm	2012-11-06 16:50:25 +0000
@@ -18,6 +18,11 @@
 			rm -rf /var/lib/maas
 		fi
 
+		# Delete symlink for iSCSI config.
+		if [ -L /etc/tgt/conf.d/maas.conf ]; then
+			rm -rf /etc/tgt/conf.d/maas.conf
+		fi
+
 esac
 
 #DEBHELPER#

=== modified file 'debian/maas-region-controller.install'
--- debian/maas-region-controller.install	2012-10-26 10:51:16 +0000
+++ debian/maas-region-controller.install	2012-11-06 16:50:25 +0000
@@ -22,21 +22,6 @@
 # Install txlongpoll config file
 debian/tmp/etc/maas/txlongpoll.yaml
 
-# Install maas-import-pxe-files
-debian/tmp/usr/sbin/maas-import-pxe-files
-
-# Install maas-import-pxe-files and related files
-etc/cron.d/maas-import-pxe-files
-man/maas-import-pxe-files.8 usr/share/man/man8
-debian/tmp/etc/maas/import_pxe_files
-debian/tmp/usr/sbin/maas-import-squashfs
-debian/tmp/etc/maas/import_squashfs
-debian/tmp/usr/sbin/maas-import-ephemerals
-debian/tmp/etc/maas/import_ephemerals
-debian/tmp/etc/maas/commissioning-user-data
-# Obsolete, but still available for compatibility:
-scripts/maas-import-isos usr/sbin
-
 # Install new preseed files
 debian/tmp/usr/share/maas/preseeds
 

=== modified file 'debian/maas-region-controller.postinst'
--- debian/maas-region-controller.postinst	2012-10-16 14:30:48 +0000
+++ debian/maas-region-controller.postinst	2012-11-06 16:50:25 +0000
@@ -104,14 +104,6 @@
 	fi
 }
 
-configure_maas_tgt(){
-	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
-}
-
 configure_maas_default_url() {
 	local ipaddr="$1"
 
@@ -227,11 +219,6 @@
 	configure_maas_workers_rabbitmq_user "$ipaddr"
 
 	#########################################################
-	######## add maas.conf to tgt conf.d ####################
-	#########################################################
-	configure_maas_tgt
-
-	#########################################################
 	################  Configure Database  ###################
 	#########################################################
 

=== modified file 'debian/maas-region-controller.postrm'
--- debian/maas-region-controller.postrm	2012-10-11 18:16:28 +0000
+++ debian/maas-region-controller.postrm	2012-11-06 16:50:25 +0000
@@ -27,11 +27,6 @@
 		fi
 
 		# Delete symlink
-		if [ -L /etc/tgt/conf.d/maas.conf ]; then
-			rm -rf /etc/tgt/conf.d/maas.conf
-		fi
-
-		# Delete symlink
 		if [ -L /etc/squid-deb-proxy/mirror-dstdomain.acl.d/99-maas ]; then
 			rm -rf /etc/squid-deb-proxy/mirror-dstdomain.acl.d/99-maas
 		fi


Follow ups