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

Proposed by Jeroen T. Vermeulen on 2012-12-12
Status: Merged
Approved by: Jeroen T. Vermeulen on 2012-12-12
Approved revision: 150
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) 2012-12-12 Approve on 2012-12-12
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.
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.

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
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
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-12-04 16:12:43 +0000
3+++ debian/changelog 2012-12-12 12:53:47 +0000
4@@ -1,4 +1,4 @@
5-maas (0.1+bzr1325+dfsg-0ubuntu1) UNRELEASED; urgency=low
6+maas (0.1+bzr1335+dfsg-0ubuntu1) UNRELEASED; urgency=low
7
8 * New upstream bugfix release. Fixes:
9 - The DNS configuration is not created if maas-dns is installed after
10@@ -57,6 +57,12 @@
11 * debian/maas-cluster-controller.install: maas-import-squashfs and its
12 configuration file are no longer part of upstream.
13
14+ [ Jeroen Vermeulen ]
15+ * debian/maas-cluster-controller.maas-pserv.upstart: Source maas_cluster.conf
16+ before starting pserv (tftpd) process.
17+ * debian/maas-cluster-controller.postinst: Duplicate CLUSTER_UUID setting
18+ to maas_cluster.conf.
19+
20 -- Andres Rodriguez <andreserl@ubuntu.com> Tue, 13 Nov 2012 14:58:21 -0500
21
22 maas (0.1+bzr1269+dfsg-0ubuntu1) quantal-proposed; urgency=low
23
24=== modified file 'debian/maas-cluster-controller.maas-pserv.upstart'
25--- debian/maas-cluster-controller.maas-pserv.upstart 2012-09-25 08:02:30 +0000
26+++ debian/maas-cluster-controller.maas-pserv.upstart 2012-12-12 12:53:47 +0000
27@@ -10,5 +10,19 @@
28
29 respawn
30
31-# To add options to your daemon, edit the line below:
32-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
33+env CONFIG_FILE=/etc/maas/maas_cluster.conf
34+
35+pre-start script
36+ if [ ! -f $CONFIG_FILE ]; then
37+ echo "$CONFIG_FILE does not exist. Aborting."
38+ stop
39+ exit 0
40+ fi
41+end script
42+
43+script
44+ # Prepare settings.
45+ . $CONFIG_FILE
46+ # To add options to your daemon, edit the line below:
47+ 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
48+end script
49
50=== modified file 'debian/maas-cluster-controller.postinst'
51--- debian/maas-cluster-controller.postinst 2012-11-29 02:34:20 +0000
52+++ debian/maas-cluster-controller.postinst 2012-12-12 12:53:47 +0000
53@@ -26,6 +26,48 @@
54 ln -sf /var/lib/maas/ephemeral/tgt.conf /etc/tgt/conf.d/maas.conf
55 }
56
57+extract_cluster_uuid(){
58+ # Extract ClUSTER_UUID setting from config file $1. This will work
59+ # both the cluster celery config (which is python) and the cluster
60+ # config (which is shell).
61+ local config_file="$1"
62+ grep "^CLUSTER_UUID *= *[\"'][^\"']*[\"']" $config_file |
63+ sed -e "s/^CLUSTER_UUID *= *\"\([^\"']*\)\".*/\1/"
64+}
65+
66+configure_cluster_uuid(){
67+ # The cluster uuid goes into maas_cluster.conf, but we also still
68+ # keep a copy in maas_local_celeryconfig_cluster.py (hopefully just
69+ # temporarily). If an old uuid is configured, we replicate that to
70+ # maas_cluster.conf; otherwise, we want to generate one.
71+ local uuid
72+
73+
74+ if [ -n "$(extract_cluster_uuid /etc/maas/maas_cluster.conf)" ]; then
75+ # UUID is already set up. Wonderful.
76+ return
77+ fi
78+
79+ # Look for a UUID stored in the old location.
80+ uuid="$(extract_cluster_uuid /etc/maas/maas_local_celeryconfig_cluster.py)"
81+
82+ if [ -z "$uuid" ]; then
83+ # No UUID at all yet. Generate one, and insert it into its
84+ # placeholder in the old config location.
85+ uuid="$(uuidgen)"
86+ sed -i "s|^CLUSTER_UUID = None$|CLUSTER_UUID = '$uuid'|" \
87+ /etc/maas/maas_local_celeryconfig_cluster.py
88+ fi
89+
90+ # Either way, at this point we have a uuid, and it is configured in
91+ # the old config location.
92+ #
93+ # Write it to maas_cluster.conf as well. There is no initial
94+ # placeholder in this file, so just append the setting.
95+ echo "CLUSTER_UUID=\"$uuid\"" >>/etc/maas/maas_cluster.conf
96+}
97+
98+
99 if [ "$1" = "configure" ] && [ -z "$2" ]; then
100 # logging
101 create_log_dir
102@@ -35,13 +77,6 @@
103 chown root:maas /etc/maas/maas_local_celeryconfig_cluster.py
104 chmod 0640 /etc/maas/maas_local_celeryconfig_cluster.py
105
106- # Generate cluster UUID.
107- if grep -qs "^CLUSTER_UUID\ \= None$" /etc/maas/maas_local_celeryconfig_cluster.py; then
108- uuid="$(uuidgen)"
109- sed -i "s|^CLUSTER_UUID\ \= None$|CLUSTER_UUID = '"$uuid"'|" \
110- /etc/maas/maas_local_celeryconfig_cluster.py
111- fi
112-
113 configure_maas_tgt
114 fi
115
116@@ -63,5 +98,9 @@
117 fi
118 fi
119
120+if [ "$1" = "configure" ]; then
121+ configure_cluster_uuid
122+fi
123+
124 #DEBHELPER#
125 exit 0

Subscribers

People subscribed via source and target branches