diff options
author | Michael Still <mikal@stillhq.com> | 2018-04-25 19:25:09 +1000 |
---|---|---|
committer | Michael Still <mikal@stillhq.com> | 2018-05-02 19:18:41 +1000 |
commit | b3d2c2a94a227fd7498ce2eded0bde440a521cb2 (patch) | |
tree | be1ea63ddf3b3834017ae61b503cc94d2ba5cabd /nova/crypto.py | |
parent | d08314d80fb9b72c43fdf90249c8b1b81b503d8c (diff) | |
download | nova-b3d2c2a94a227fd7498ce2eded0bde440a521cb2.tar.gz |
Convert certificate generation to processutils.
Its a bit concerning that this doesn't have unit test coverage,
but I'm just here to make things no use utils.execute().
Change-Id: I76ccea47245d46def4b500e29681200ae951b7d0
blueprint: execs-ive-had-a-few
Diffstat (limited to 'nova/crypto.py')
-rw-r--r-- | nova/crypto.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/crypto.py b/nova/crypto.py index d5b29f85c8..5b96a0ef4b 100644 --- a/nova/crypto.py +++ b/nova/crypto.py @@ -30,6 +30,7 @@ from cryptography.hazmat.primitives.asymmetric import padding from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives import serialization from cryptography import x509 +from oslo_concurrency import processutils from oslo_log import log as logging import paramiko import six @@ -119,14 +120,14 @@ def generate_winrm_x509_cert(user_id, bits=2048): _create_x509_openssl_config(conffile, upn) - (certificate, _err) = utils.execute( + (certificate, _err) = processutils.execute( 'openssl', 'req', '-x509', '-nodes', '-days', '3650', '-config', conffile, '-newkey', 'rsa:%s' % bits, '-outform', 'PEM', '-keyout', keyfile, '-subj', subject, '-extensions', 'v3_req_client', binary=True) - (out, _err) = utils.execute('openssl', 'pkcs12', '-export', + (out, _err) = processutils.execute('openssl', 'pkcs12', '-export', '-inkey', keyfile, '-password', 'pass:', process_input=certificate, binary=True) |