Fix issues with keystone-dsvm-py35-functional-v3-only on py35
keystone/token/providers/fernet/token_formatters.py
* decode payload[2] from bytes to string before comparing
with a string (CONF.identity.default_domain_id)
keystone_tempest_plugin/services/identity/clients.py
keystone_tempest_plugin/services/identity/v3/auth_client.py
keystone_tempest_plugin/services/identity/v3/identity_providers_client.py
* decode the response body from bytes to string before we
try to parse the json using json.loads
Change-Id: I98053bc498d78c5f0076a66e725ff2d634f5b663
diff --git a/keystone_tempest_plugin/services/identity/clients.py b/keystone_tempest_plugin/services/identity/clients.py
index caf8b52..aac45d3 100644
--- a/keystone_tempest_plugin/services/identity/clients.py
+++ b/keystone_tempest_plugin/services/identity/clients.py
@@ -14,6 +14,7 @@
import json
+import six
from six.moves import http_client
from tempest import config
from tempest.lib.common import rest_client
@@ -59,19 +60,19 @@
url = self._build_path(entity_id)
resp, body = super(Federation, self).get(url, **kwargs)
self.expected_success(http_client.OK, resp.status)
- body = json.loads(body)
+ body = json.loads(body if six.PY2 else body.decode('utf-8'))
return rest_client.ResponseBody(resp, body)
def _patch(self, entity_id, body, **kwargs):
url = self._build_path(entity_id)
resp, body = super(Federation, self).patch(url, body, **kwargs)
self.expected_success(http_client.OK, resp.status)
- body = json.loads(body)
+ body = json.loads(body if six.PY2 else body.decode('utf-8'))
return rest_client.ResponseBody(resp, body)
def _put(self, entity_id, body, **kwargs):
url = self._build_path(entity_id)
resp, body = super(Federation, self).put(url, body, **kwargs)
self.expected_success(http_client.CREATED, resp.status)
- body = json.loads(body)
+ body = json.loads(body if six.PY2 else body.decode('utf-8'))
return rest_client.ResponseBody(resp, body)