Merge lp:~andreserl/maas/maas_lp1040047 into lp:maas/trunk
Proposed by
Andres Rodriguez
on 2012-08-22
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Andres Rodriguez on 2012-08-22 | ||||
| Approved revision: | 910 | ||||
| Merged at revision: | 910 | ||||
| Proposed branch: | lp:~andreserl/maas/maas_lp1040047 | ||||
| Merge into: | lp:maas/trunk | ||||
| Diff against target: |
15 lines (+5/-1) 1 file modified
src/provisioningserver/omshell.py (+5/-1) |
||||
| To merge this branch: | bzr merge lp:~andreserl/maas/maas_lp1040047 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gavin Panella (community) | 2012-08-22 | Approve on 2012-08-22 | |
|
Review via email:
|
|||
Commit Message
Use dnssec-keygen absolute path otherwise MAAS fails (LP: #1040047)
To post a comment you must log in.
| Gavin Panella (allenap) wrote : | # |
review:
Approve


> === modified file 'src/provisioni ngserver/ omshell. py' gserver/ omshell. py 2012-08-07 10:20:38 +0000 gserver/ omshell. py 2012-08-22 13:35:57 +0000 keygen( tmpdir) : exists( '/usr/sbin/ dnssec- keygen' ): dnssec- keygen'
> --- src/provisionin
> +++ src/provisionin
> @@ -32,8 +32,12 @@
>
>
> def call_dnssec_
> + dnssec_keygen = 'dnssec-keygen'
> + if os.path.
> + dnssec_keygen = '/usr/sbin/
> +
> return check_output(
> - ['dnssec-keygen', '-r', '/dev/urandom', '-a', 'HMAC-MD5',
> + [dnssec_keygen, '-r', '/dev/urandom', '-a', 'HMAC-MD5',
> '-b', '512', '-n', 'HOST', '-K', tmpdir, '-q', 'omapi_key'])
This is okay, but can I suggest an alternative approach?
I think it would be better to run the command in an environment with a
modified PATH, where /usr/sbin is appended. That way, if the caller
wants to use a different dnssec-keygen they can. The attached diff
demonstrates what I mean.
Another alternative would be to always use /usr/sbin/ dnssec- keygen. If
they don't have it, they need to install it.
+1