diff --git a/services/policy/policy_client.py b/services/policy/policy_client.py index 6cb9495..3ca70f6 100644 --- a/services/policy/policy_client.py +++ b/services/policy/policy_client.py @@ -13,8 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import json - +from oslo_serialization import jsonutils as json from tempest.lib.common import rest_client diff --git a/tests/scenario/congress_ha/test_ha.py b/tests/scenario/congress_ha/test_ha.py index 9bb2ceb..25835ac 100644 --- a/tests/scenario/congress_ha/test_ha.py +++ b/tests/scenario/congress_ha/test_ha.py @@ -15,11 +15,11 @@ import os import socket -from StringIO import StringIO import subprocess import tempfile from oslo_log import log as logging +import six from tempest.common import credentials_factory as credentials from tempest import config from tempest.lib.common.utils import test_utils @@ -219,7 +219,7 @@ class TestHA(manager_congress.ScenarioPolicyBase): LOG.debug("Replica port %s service %s logs: %s", port_num, service_key, - StringIO(output).getvalue()) + six.StringIO(output.decode()).getvalue()) raise exceptions.TimeoutException("Replica Server not ready") # Relica server is up replica_server = True diff --git a/tests/scenario/test_congress_basic_ops.py b/tests/scenario/test_congress_basic_ops.py index 9464699..0a89c0a 100644 --- a/tests/scenario/test_congress_basic_ops.py +++ b/tests/scenario/test_congress_basic_ops.py @@ -14,6 +14,10 @@ # License for the specific language governing permissions and limitations # under the License. +import random +import string +import time + from tempest.common import utils from tempest import config from tempest.lib.common.utils import test_utils @@ -23,11 +27,6 @@ from tempest.lib import exceptions from congress_tempest_tests.tests.scenario import helper from congress_tempest_tests.tests.scenario import manager_congress -import random -import string -import time - - CONF = config.CONF @@ -49,7 +48,7 @@ class TestPolicyBasicOps(manager_congress.ScenarioPolicyBase): self.servers = [] def _create_random_policy(self): - policy_name = "nova_%s" % ''.join(random.choice(string.lowercase) + policy_name = "nova_%s" % ''.join(random.choice(string.ascii_lowercase) for x in range(10)) body = {"name": policy_name} resp = self.os_admin.congress_client.create_policy(body)