Merge lp:~andreserl/maas/fix_lp1413388 into lp:~maas-maintainers/maas/packaging

Proposed by Andres Rodriguez on 2015-07-07
Status: Merged
Approved by: Andres Rodriguez on 2015-07-09
Approved revision: 416
Merged at revision: 414
Proposed branch: lp:~andreserl/maas/fix_lp1413388
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 78 lines (+16/-20)
3 files modified
debian/changelog (+4/-1)
debian/maas-dns.postinst (+2/-19)
debian/maas-region-controller.postinst (+10/-0)
To merge this branch: bzr merge lp:~andreserl/maas/fix_lp1413388
Reviewer Review Type Date Requested Status
Mike Pontillo (community) 2015-07-07 Approve on 2015-07-07
Review via email: mp+263993@code.launchpad.net

Commit message

LP: #1413388 Handle upgrades to migrate named.conf.settings

To post a comment you must log in.
Mike Pontillo (mpontillo) wrote :

Looks pretty good; a few things need fixing, but since I trust you to fix them I'll mark it approved. ;-)

(1) (applies to all branches) The Python code now checks if the migration needs to happen before unconditionally migrating, so we can move the 'grep' logic out of the packaging. We should remove the 'grep' statements from the maas-dns postinst as well.

(2) I thought we also decided to leave the 'edit_named_options' call in the mass-dns postinst for the maas-region-controller-min use case.

review: Approve
lp:~andreserl/maas/fix_lp1413388 updated on 2015-07-07
415. By Andres Rodriguez on 2015-07-07

Address comments

Mike Pontillo (mpontillo) wrote :

Looks good. Just one comment about an unused variable below.

review: Approve
lp:~andreserl/maas/fix_lp1413388 updated on 2015-07-08
416. By Andres Rodriguez on 2015-07-08

Remove unnecessary variable

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 2015-07-04 02:22:26 +0000
3+++ debian/changelog 2015-07-08 01:12:57 +0000
4@@ -7,10 +7,13 @@
5 * Drop dependency on python-iscpy: the code has been integrated into
6 MAAS. (LP: #1413388).
7
8-
9 [ Gavin Panella ]
10 * Use new local configuration support for the cluster.
11
12+ [ Andres Rodriguez ]
13+ * Refactor maas-dns upgrade code so it doesn't break local DNS config
14+ and it gets migrated (LP: #1413388)
15+
16 -- Andres Rodriguez <andreserl@ubuntu.com> Fri, 12 Jun 2015 14:16:47 -0400
17
18 maas (1.8.0+bzr4001-0ubuntu1) trusty; urgency=medium
19
20=== modified file 'debian/maas-dns.postinst'
21--- debian/maas-dns.postinst 2015-07-03 14:26:39 +0000
22+++ debian/maas-dns.postinst 2015-07-08 01:12:57 +0000
23@@ -52,25 +52,8 @@
24 # Fix permissions
25 fix_dns_permissions
26
27- # If the /etc/bind/named.conf.options is not set up yet, do it now.
28- # This might happen because of an upgrade from an older package.
29- should_edit_named_options=0
30-
31- # If the MAAS include statement doesn't exist in named.conf.local, we need to add it.
32- grep -qs '^include\s.*maas' /etc/bind/named.conf.local || should_edit_named_options=1
33-
34- # If the 'forwarders' option exists in named.conf.options, it needs to be removed.
35- grep -qs "forwarders" /etc/bind/named.conf.options && should_edit_named_options=1
36-
37- # If the 'dnssec-validation' option exists in named.conf.options, it needs to be removed.
38- grep -qs "dnssec-validation" /etc/bind/named.conf.options && should_edit_named_options=1
39-
40- # If the include file for the custom MAAS named.conf.options doesn't exist, it needs to be added.
41- grep -qs "named.conf.options.inside.maas" /etc/bind/named.conf.options || should_edit_named_options=1
42-
43- if [ $should_edit_named_options -eq 1 ]; then
44- edit_named_options
45- fi
46+ # ensure that DNS config is included
47+ edit_named_options
48 fi
49
50 invoke-rc.d bind9 restart || true
51
52=== modified file 'debian/maas-region-controller.postinst'
53--- debian/maas-region-controller.postinst 2015-07-03 14:26:39 +0000
54+++ debian/maas-region-controller.postinst 2015-07-08 01:12:57 +0000
55@@ -44,6 +44,15 @@
56 grep "^DEFAULT_MAAS_URL" "$1" | cut -d"/" -f3
57 }
58
59+configure_migrate_maas_dns() {
60+ # This only runs on upgrade. We only run this if the
61+ # there are forwarders to migrate or no
62+ # named.conf.options.inside.maas are present.
63+ maas-region-admin edit_named_options \
64+ --migrate-conflicting-options --config-path \
65+ /etc/bind/named.conf.options
66+ invoke-rc.d bind9 restart || true
67+}
68
69 if [ "$1" = "configure" ] && [ -z "$2" ]; then
70 #########################################################
71@@ -137,6 +146,7 @@
72
73 maas_sync_migrate_db
74
75+ configure_migrate_maas_dns
76 fi
77
78 invoke-rc.d maas-regiond restart || true

Subscribers

People subscribed via source and target branches

to all changes: