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

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
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) Approve
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.
Revision history for this message
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
415. By Andres Rodriguez

Address comments

Revision history for this message
Mike Pontillo (mpontillo) wrote :

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

review: Approve
lp:~andreserl/maas/fix_lp1413388 updated
416. By Andres Rodriguez

Remove unnecessary variable

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2015-07-04 02:22:26 +0000
+++ debian/changelog 2015-07-08 01:12:57 +0000
@@ -7,10 +7,13 @@
7 * Drop dependency on python-iscpy: the code has been integrated into7 * Drop dependency on python-iscpy: the code has been integrated into
8 MAAS. (LP: #1413388).8 MAAS. (LP: #1413388).
99
10
11 [ Gavin Panella ]10 [ Gavin Panella ]
12 * Use new local configuration support for the cluster.11 * Use new local configuration support for the cluster.
1312
13 [ Andres Rodriguez ]
14 * Refactor maas-dns upgrade code so it doesn't break local DNS config
15 and it gets migrated (LP: #1413388)
16
14 -- Andres Rodriguez <andreserl@ubuntu.com> Fri, 12 Jun 2015 14:16:47 -040017 -- Andres Rodriguez <andreserl@ubuntu.com> Fri, 12 Jun 2015 14:16:47 -0400
1518
16maas (1.8.0+bzr4001-0ubuntu1) trusty; urgency=medium19maas (1.8.0+bzr4001-0ubuntu1) trusty; urgency=medium
1720
=== modified file 'debian/maas-dns.postinst'
--- debian/maas-dns.postinst 2015-07-03 14:26:39 +0000
+++ debian/maas-dns.postinst 2015-07-08 01:12:57 +0000
@@ -52,25 +52,8 @@
52 # Fix permissions52 # Fix permissions
53 fix_dns_permissions53 fix_dns_permissions
5454
55 # If the /etc/bind/named.conf.options is not set up yet, do it now.55 # ensure that DNS config is included
56 # This might happen because of an upgrade from an older package.56 edit_named_options
57 should_edit_named_options=0
58
59 # If the MAAS include statement doesn't exist in named.conf.local, we need to add it.
60 grep -qs '^include\s.*maas' /etc/bind/named.conf.local || should_edit_named_options=1
61
62 # If the 'forwarders' option exists in named.conf.options, it needs to be removed.
63 grep -qs "forwarders" /etc/bind/named.conf.options && should_edit_named_options=1
64
65 # If the 'dnssec-validation' option exists in named.conf.options, it needs to be removed.
66 grep -qs "dnssec-validation" /etc/bind/named.conf.options && should_edit_named_options=1
67
68 # If the include file for the custom MAAS named.conf.options doesn't exist, it needs to be added.
69 grep -qs "named.conf.options.inside.maas" /etc/bind/named.conf.options || should_edit_named_options=1
70
71 if [ $should_edit_named_options -eq 1 ]; then
72 edit_named_options
73 fi
74fi57fi
7558
76invoke-rc.d bind9 restart || true59invoke-rc.d bind9 restart || true
7760
=== modified file 'debian/maas-region-controller.postinst'
--- debian/maas-region-controller.postinst 2015-07-03 14:26:39 +0000
+++ debian/maas-region-controller.postinst 2015-07-08 01:12:57 +0000
@@ -44,6 +44,15 @@
44 grep "^DEFAULT_MAAS_URL" "$1" | cut -d"/" -f344 grep "^DEFAULT_MAAS_URL" "$1" | cut -d"/" -f3
45}45}
4646
47configure_migrate_maas_dns() {
48 # This only runs on upgrade. We only run this if the
49 # there are forwarders to migrate or no
50 # named.conf.options.inside.maas are present.
51 maas-region-admin edit_named_options \
52 --migrate-conflicting-options --config-path \
53 /etc/bind/named.conf.options
54 invoke-rc.d bind9 restart || true
55}
4756
48if [ "$1" = "configure" ] && [ -z "$2" ]; then57if [ "$1" = "configure" ] && [ -z "$2" ]; then
49 #########################################################58 #########################################################
@@ -137,6 +146,7 @@
137146
138 maas_sync_migrate_db147 maas_sync_migrate_db
139148
149 configure_migrate_maas_dns
140fi150fi
141151
142invoke-rc.d maas-regiond restart || true152invoke-rc.d maas-regiond restart || true

Subscribers

People subscribed via source and target branches

to all changes: