← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~allenap/maas/alt-fix-for-maas_lp1040047 into lp:maas

 

Gavin Panella has proposed merging lp:~allenap/maas/alt-fix-for-maas_lp1040047 into lp:maas.

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~allenap/maas/alt-fix-for-maas_lp1040047/+merge/120866

I suggested this alternative fix in https://code.launchpad.net/~andreserl/maas/maas_lp1040047/+merge/120769 but the branch was landed without it. However, roaksoax agreed it was okay, so I'm landing it here.
-- 
https://code.launchpad.net/~allenap/maas/alt-fix-for-maas_lp1040047/+merge/120866
Your team MAAS Maintainers is requested to review the proposed merge of lp:~allenap/maas/alt-fix-for-maas_lp1040047 into lp:maas.
=== modified file 'src/provisioningserver/omshell.py'
--- src/provisioningserver/omshell.py	2012-08-22 12:32:37 +0000
+++ src/provisioningserver/omshell.py	2012-08-22 20:41:20 +0000
@@ -32,13 +32,13 @@
 
 
 def call_dnssec_keygen(tmpdir):
-    dnssec_keygen = 'dnssec-keygen'
-    if os.path.exists('/usr/sbin/dnssec-keygen'):
-        dnssec_keygen = '/usr/sbin/dnssec-keygen'
-
+    path = os.environ.get("PATH", "").split(os.pathsep)
+    path.append("/usr/sbin")
+    env = dict(os.environ, PATH=os.pathsep.join(path))
     return check_output(
-        [dnssec_keygen, '-r', '/dev/urandom', '-a', 'HMAC-MD5',
-         '-b', '512', '-n', 'HOST', '-K', tmpdir, '-q', 'omapi_key'])
+        ['dnssec-keygen', '-r', '/dev/urandom', '-a', 'HMAC-MD5',
+         '-b', '512', '-n', 'HOST', '-K', tmpdir, '-q', 'omapi_key'],
+        env=env)
 
 
 def generate_omapi_key():