diff options
| author | zhubingbing <1392607554@qq.com> | 2017-03-11 15:29:45 +0800 |
|---|---|---|
| committer | zhubingbing <1392607554@qq.com> | 2017-03-22 20:43:14 +0800 |
| commit | 6d0e31f2320d382b40747a75c56b069baa28c445 (patch) | |
| tree | cd317543bfeb4d171ddbb10e7fa043117836fd82 /kolla_ansible/cmd | |
| parent | c0df4ab8b601a0030783d8402ef8fe71b899c3b0 (diff) | |
| download | kolla-ansible-6d0e31f2320d382b40747a75c56b069baa28c445.tar.gz kolla-ansible-6d0e31f2320d382b40747a75c56b069baa28c445.zip | |
Fix can't find /usr/lib/libCryptoki2_64.so in barbican
Link https://docs.openstack.org/project-install-guide/key-manager/newton/barbican-backend.html#simple-crypto-plugin
Change-Id: I351738c2a98090c56ac69e477fbe5ddec4cc5b26
Closes-Bug: #1672001
Diffstat (limited to 'kolla_ansible/cmd')
| -rwxr-xr-x | kolla_ansible/cmd/genpwd.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kolla_ansible/cmd/genpwd.py b/kolla_ansible/cmd/genpwd.py index cfd3319c4..34d4c713c 100755 --- a/kolla_ansible/cmd/genpwd.py +++ b/kolla_ansible/cmd/genpwd.py @@ -21,6 +21,7 @@ import sys from Crypto.PublicKey import RSA from hashlib import md5 +from hashlib import sha256 from oslo_utils import uuidutils import yaml @@ -70,6 +71,9 @@ def main(): # HMAC-MD5 keys hmac_md5_keys = ['designate_rndc_key'] + # HMAC-SHA256 keys + hmac_sha256_keys = ['barbican_crypto_key'] + # length of password length = 40 @@ -96,6 +100,10 @@ def main(): passwords[k] = (hmac.new( uuidutils.generate_uuid(), '', md5) .digest().encode('base64')[:-1]) + elif k in hmac_sha256_keys: + passwords[k] = (hmac.new( + uuidutils.generate_uuid(), '', sha256) + .digest().encode('base64')[:-1]) else: passwords[k] = ''.join([ random.SystemRandom().choice( |
