Merge lp:~jtv/maas/p-sru-pkg-bug-1086239 into lp:~maas-maintainers/maas/packaging.precise.sru

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: 150
Proposed branch: lp:~jtv/maas/p-sru-pkg-bug-1086239
Merge into: lp:~maas-maintainers/maas/packaging.precise.sru
Diff against target: 125 lines (+69/-10)
3 files modified
debian/changelog (+7/-1)
debian/maas-cluster-controller.maas-pserv.upstart (+16/-2)
debian/maas-cluster-controller.postinst (+46/-7)
To merge this branch: bzr merge lp:~jtv/maas/p-sru-pkg-bug-1086239
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+139459@code.launchpad.net

Commit message

Backport packaging r156 to Precise SRU packaging branch.

Description of the change

This is the same backport I've already landed for the packaging and packaging.quantal branches, but this time, for the Precise packaging branch.

Unfortunately I can't test the resulting package. The Precise SRU package is apparently broken at the moment, and specifically, there's no installable python-txtftpd. Raphael asked me to land this first.

Jeroen

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

I think you misunderstood what I said, I said that I think the package was broken because this fix is missing (here is the error I get: http://paste.ubuntu.com/1427304/). I'll see if I can test this fix.

Revision history for this message
Raphaël Badin (rvb) wrote :

As discussed on IRC, let's land this and then we will be able to fix the error that I'm seeing trying out the package (http://paste.ubuntu.com/1427696/).

review: Approve
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

> I think you misunderstood what I said, I said that I think the package was
> broken because this fix is missing (here is the error I get:
> http://paste.ubuntu.com/1427304/). I'll see if I can test this fix.

No, I was referring to another problem.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-12-04 16:12:43 +0000
+++ debian/changelog 2012-12-12 12:53:47 +0000
@@ -1,4 +1,4 @@
1maas (0.1+bzr1325+dfsg-0ubuntu1) UNRELEASED; urgency=low1maas (0.1+bzr1335+dfsg-0ubuntu1) UNRELEASED; urgency=low
22
3 * New upstream bugfix release. Fixes:3 * New upstream bugfix release. Fixes:
4 - The DNS configuration is not created if maas-dns is installed after4 - The DNS configuration is not created if maas-dns is installed after
@@ -57,6 +57,12 @@
57 * debian/maas-cluster-controller.install: maas-import-squashfs and its57 * debian/maas-cluster-controller.install: maas-import-squashfs and its
58 configuration file are no longer part of upstream.58 configuration file are no longer part of upstream.
5959
60 [ Jeroen Vermeulen ]
61 * debian/maas-cluster-controller.maas-pserv.upstart: Source maas_cluster.conf
62 before starting pserv (tftpd) process.
63 * debian/maas-cluster-controller.postinst: Duplicate CLUSTER_UUID setting
64 to maas_cluster.conf.
65
60 -- Andres Rodriguez <andreserl@ubuntu.com> Tue, 13 Nov 2012 14:58:21 -050066 -- Andres Rodriguez <andreserl@ubuntu.com> Tue, 13 Nov 2012 14:58:21 -0500
6167
62maas (0.1+bzr1269+dfsg-0ubuntu1) quantal-proposed; urgency=low68maas (0.1+bzr1269+dfsg-0ubuntu1) quantal-proposed; urgency=low
6369
=== modified file 'debian/maas-cluster-controller.maas-pserv.upstart'
--- debian/maas-cluster-controller.maas-pserv.upstart 2012-09-25 08:02:30 +0000
+++ debian/maas-cluster-controller.maas-pserv.upstart 2012-12-12 12:53:47 +0000
@@ -10,5 +10,19 @@
1010
11respawn11respawn
1212
13# To add options to your daemon, edit the line below:13env CONFIG_FILE=/etc/maas/maas_cluster.conf
14exec /usr/bin/twistd -n --uid=maas --gid=maas --pidfile=/run/maas-pserv.pid --logfile=/dev/null maas-pserv --config-file=/etc/maas/pserv.yaml14
15pre-start script
16 if [ ! -f $CONFIG_FILE ]; then
17 echo "$CONFIG_FILE does not exist. Aborting."
18 stop
19 exit 0
20 fi
21end script
22
23script
24 # Prepare settings.
25 . $CONFIG_FILE
26 # To add options to your daemon, edit the line below:
27 exec /usr/bin/twistd -n --uid=maas --gid=maas --pidfile=/run/maas-pserv.pid --logfile=/dev/null maas-pserv --config-file=/etc/maas/pserv.yaml
28end script
1529
=== modified file 'debian/maas-cluster-controller.postinst'
--- debian/maas-cluster-controller.postinst 2012-11-29 02:34:20 +0000
+++ debian/maas-cluster-controller.postinst 2012-12-12 12:53:47 +0000
@@ -26,6 +26,48 @@
26 ln -sf /var/lib/maas/ephemeral/tgt.conf /etc/tgt/conf.d/maas.conf26 ln -sf /var/lib/maas/ephemeral/tgt.conf /etc/tgt/conf.d/maas.conf
27}27}
2828
29extract_cluster_uuid(){
30 # Extract ClUSTER_UUID setting from config file $1. This will work
31 # both the cluster celery config (which is python) and the cluster
32 # config (which is shell).
33 local config_file="$1"
34 grep "^CLUSTER_UUID *= *[\"'][^\"']*[\"']" $config_file |
35 sed -e "s/^CLUSTER_UUID *= *\"\([^\"']*\)\".*/\1/"
36}
37
38configure_cluster_uuid(){
39 # The cluster uuid goes into maas_cluster.conf, but we also still
40 # keep a copy in maas_local_celeryconfig_cluster.py (hopefully just
41 # temporarily). If an old uuid is configured, we replicate that to
42 # maas_cluster.conf; otherwise, we want to generate one.
43 local uuid
44
45
46 if [ -n "$(extract_cluster_uuid /etc/maas/maas_cluster.conf)" ]; then
47 # UUID is already set up. Wonderful.
48 return
49 fi
50
51 # Look for a UUID stored in the old location.
52 uuid="$(extract_cluster_uuid /etc/maas/maas_local_celeryconfig_cluster.py)"
53
54 if [ -z "$uuid" ]; then
55 # No UUID at all yet. Generate one, and insert it into its
56 # placeholder in the old config location.
57 uuid="$(uuidgen)"
58 sed -i "s|^CLUSTER_UUID = None$|CLUSTER_UUID = '$uuid'|" \
59 /etc/maas/maas_local_celeryconfig_cluster.py
60 fi
61
62 # Either way, at this point we have a uuid, and it is configured in
63 # the old config location.
64 #
65 # Write it to maas_cluster.conf as well. There is no initial
66 # placeholder in this file, so just append the setting.
67 echo "CLUSTER_UUID=\"$uuid\"" >>/etc/maas/maas_cluster.conf
68}
69
70
29if [ "$1" = "configure" ] && [ -z "$2" ]; then71if [ "$1" = "configure" ] && [ -z "$2" ]; then
30 # logging72 # logging
31 create_log_dir73 create_log_dir
@@ -35,13 +77,6 @@
35 chown root:maas /etc/maas/maas_local_celeryconfig_cluster.py77 chown root:maas /etc/maas/maas_local_celeryconfig_cluster.py
36 chmod 0640 /etc/maas/maas_local_celeryconfig_cluster.py78 chmod 0640 /etc/maas/maas_local_celeryconfig_cluster.py
3779
38 # Generate cluster UUID.
39 if grep -qs "^CLUSTER_UUID\ \= None$" /etc/maas/maas_local_celeryconfig_cluster.py; then
40 uuid="$(uuidgen)"
41 sed -i "s|^CLUSTER_UUID\ \= None$|CLUSTER_UUID = '"$uuid"'|" \
42 /etc/maas/maas_local_celeryconfig_cluster.py
43 fi
44
45 configure_maas_tgt80 configure_maas_tgt
46fi81fi
4782
@@ -63,5 +98,9 @@
63 fi98 fi
64fi99fi
65100
101if [ "$1" = "configure" ]; then
102 configure_cluster_uuid
103fi
104
66#DEBHELPER#105#DEBHELPER#
67exit 0106exit 0

Subscribers

People subscribed via source and target branches