launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #11372
[Merge] lp:~jtv/maas/dns-cosmetics into lp:maas
Jeroen T. Vermeulen has proposed merging lp:~jtv/maas/dns-cosmetics into lp:maas.
Requested reviews:
MAAS Maintainers (maas-maintainers)
For more details, see:
https://code.launchpad.net/~jtv/maas/dns-cosmetics/+merge/121548
These are just some small things I came across while trying to figure out why test_dns.py doesn't run properly by itself. Nothing of consequence, but the work is complicated enough that removing distractions must be good.
Jeroen
--
https://code.launchpad.net/~jtv/maas/dns-cosmetics/+merge/121548
Your team MAAS Maintainers is requested to review the proposed merge of lp:~jtv/maas/dns-cosmetics into lp:maas.
=== modified file 'src/maastesting/bindfixture.py'
--- src/maastesting/bindfixture.py 2012-08-27 09:30:44 +0000
+++ src/maastesting/bindfixture.py 2012-08-28 07:32:23 +0000
@@ -117,9 +117,9 @@
def set_up_named(self, overwrite_config=True):
"""Setup an environment to run 'named'.
- - Create the default configuration for 'named' and setup rndc.
- - Copies the 'named' executable inside homedir (to by-pass the
- restrictions that apparmor imposes
+ - Create the default configuration for 'named' and set up rndc.
+ - Copies the 'named' executable inside homedir. AppArmor won't
+ let us run the installed version the way we want.
"""
# Generate rndc configuration (rndc config and named snippet).
rndcconf, namedrndcconf = generate_rndc(
=== modified file 'src/provisioningserver/dns/config.py'
--- src/provisioningserver/dns/config.py 2012-08-13 11:04:44 +0000
+++ src/provisioningserver/dns/config.py 2012-08-28 07:32:23 +0000
@@ -55,9 +55,8 @@
part is commented out) the named configuration.
"""
# Generate the configuration:
- # - 256 bits is the recommanded size for the key nowadays;
- # - Use the unlocked random source to make the executing
- # non-blocking.
+ # - 256 bits is the recommended size for the key nowadays.
+ # - Use urandom to avoid blocking on the random generator.
rndc_content = check_output(
['rndc-confgen', '-b', '256', '-r', '/dev/urandom',
'-k', key_name, '-p', str(port)])
@@ -102,12 +101,11 @@
def execute_rndc_command(arguments):
"""Execute a rndc command."""
- rndc_conf = os.path.join(
- conf.DNS_CONFIG_DIR, MAAS_RNDC_CONF_NAME)
+ rndc_conf = os.path.join(conf.DNS_CONFIG_DIR, MAAS_RNDC_CONF_NAME)
with open(os.devnull, "ab") as devnull:
check_call(
- ['rndc', '-c', rndc_conf] + map(str, arguments),
- stdout=devnull)
+ ['rndc', '-c', rndc_conf] + map(str, arguments),
+ stdout=devnull)
# Directory where the DNS configuration template files can be found.