import argparse
import contextlib
import logging
+import six
from six.moves import http_client
from six.moves.urllib.parse import urlparse
import json
rgw_access_user_resp.status < 300):
raise Exception("Cannot authenticate user "+rgw_user["username"]+" for secret creation")
# baru_resp = json.loads(baru_req.data)
- rgw_access_user_data = json.loads(rgw_access_user_resp.read())
+ rgw_access_user_data = json.loads(six.ensure_str(rgw_access_user_resp.read()))
rgw_user_id = rgw_access_user_data['access']['user']['id']
if 'secrets' in cconfig:
token_resp.status < 300):
raise Exception("Cannot authenticate user "+secret["username"]+" for secret creation")
- token_data = json.loads(token_resp.read())
+ token_data = json.loads(six.ensure_str(token_resp.read()))
token_id = token_data['access']['token']['id']
key1_json = json.dumps(
if not (barbican_sec_resp.status >= 200 and
barbican_sec_resp.status < 300):
raise Exception("Cannot create secret")
- barbican_data = json.loads(barbican_sec_resp.read())
+ barbican_data = json.loads(six.ensure_str(barbican_sec_resp.read()))
if 'secret_ref' not in barbican_data:
raise ValueError("Malformed secret creation response")
secret_ref = barbican_data["secret_ref"]