diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index d83cd4be..7313a1c3 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -117,6 +117,8 @@ _validroles = ('Administrator', 'Operator', 'Monitor') def attrib_supports_expression(attrib): + if not isinstance(attrib, str): + attrib = attrib.decode('utf8') attrib = _attraliases.get(attrib, attrib) if attrib.startswith('secret.') or attrib.startswith('crypted.'): return False diff --git a/confluent_server/confluent/httpapi.py b/confluent_server/confluent/httpapi.py index 07665e86..a8d96329 100644 --- a/confluent_server/confluent/httpapi.py +++ b/confluent_server/confluent/httpapi.py @@ -182,6 +182,8 @@ def _get_query_dict(env, reqbody, reqtype): qdict[qkey] = qvalue if reqbody is not None: if "application/x-www-form-urlencoded" in reqtype: + if not isinstance(reqbody, str): + reqbody = reqbody.decode('utf8') pbody = urlparse.parse_qs(reqbody, True) for ky in pbody: if len(pbody[ky]) > 1: # e.g. REST explorer @@ -190,6 +192,8 @@ def _get_query_dict(env, reqbody, reqtype): else: qdict[ky] = pbody[ky][0] elif 'application/json' in reqtype: + if not isinstance(reqbody, str): + reqbody = reqbody.decode('utf8') pbody = json.loads(reqbody) for key in pbody: qdict[key] = pbody[key]