Merge lp:~allenap/maas/no-extra-line-for-bind-bug-1066929 into lp:~maas-committers/maas/trunk

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 1280
Proposed branch: lp:~allenap/maas/no-extra-line-for-bind-bug-1066929
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 41 lines (+5/-4)
3 files modified
src/maasserver/management/commands/get_named_conf.py (+2/-2)
src/provisioningserver/dns/config.py (+2/-1)
src/provisioningserver/dns/tests/test_config.py (+1/-1)
To merge this branch: bzr merge lp:~allenap/maas/no-extra-line-for-bind-bug-1066929
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+129893@code.launchpad.net

Commit message

Don't start the BIND config include snippet from `maas get_named_conf` with a newline.

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

Looks good, thanks for the cleanup!

review: Approve
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Please add a changelog entry

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/management/commands/get_named_conf.py'
2--- src/maasserver/management/commands/get_named_conf.py 2012-07-16 13:22:56 +0000
3+++ src/maasserver/management/commands/get_named_conf.py 2012-10-16 13:52:28 +0000
4@@ -23,8 +23,8 @@
5 from provisioningserver.dns.config import DNSConfig
6
7
8-INCLUDE_SNIPPET_COMMENT = """
9-# Append the following content to your local BIND configuration
10+INCLUDE_SNIPPET_COMMENT = """\
11+# Append the following content to your local BIND configuration
12 # file (usually /etc/bind/named.conf.local) in order to allow
13 # MAAS to manage its DNS zones.
14 """
15
16=== modified file 'src/provisioningserver/dns/config.py'
17--- src/provisioningserver/dns/config.py 2012-10-16 10:46:26 +0000
18+++ src/provisioningserver/dns/config.py 2012-10-16 13:52:28 +0000
19@@ -234,7 +234,8 @@
20 }
21
22 def get_include_snippet(self):
23- return '\ninclude "%s";\n' % self.target_path
24+ assert '"' not in self.target_path, self.target_path
25+ return 'include "%s";\n' % self.target_path
26
27
28 def shortened_reversed_ip(ip, byte_num):
29
30=== modified file 'src/provisioningserver/dns/tests/test_config.py'
31--- src/provisioningserver/dns/tests/test_config.py 2012-10-16 10:06:22 +0000
32+++ src/provisioningserver/dns/tests/test_config.py 2012-10-16 13:52:28 +0000
33@@ -221,7 +221,7 @@
34 self.assertThat(
35 snippet,
36 MatchesAll(
37- StartsWith('\n'),
38+ Not(StartsWith('\n')),
39 EndsWith('\n'),
40 Contains(target_dir),
41 Contains('include "%s"' % dnsconfig.target_path)))