From 35112fc7c7c9398de958de68b6e90d1f2ef2ae86 Mon Sep 17 00:00:00 2001 From: zhulingjie Date: Thu, 21 Feb 2019 14:20:25 +0800 Subject: [PATCH] Update json module to jsonutils oslo project provide jsonutils, and the others project use it now, this PS to update json moudule to oslo jsonutils for consistency. Change-Id: I51bcac143d3750aa991aeed6e95e011389f011d8 --- freezer_tempest_plugin/common.py | 3 ++- freezer_tempest_plugin/tests/freezer/agent/base.py | 3 ++- .../tests/freezer/agent/test_backup_compress.py | 3 ++- freezer_tempest_plugin/tests/freezer/scenario/test_backups.py | 3 ++- .../tests/freezer_api/api/test_api_actions.py | 4 ++-- .../tests/freezer_api/api/test_api_backups.py | 4 ++-- .../tests/freezer_api/api/test_api_clients.py | 3 ++- freezer_tempest_plugin/tests/freezer_api/api/test_api_jobs.py | 4 ++-- .../tests/freezer_api/api/test_api_sessions.py | 4 ++-- .../tests/freezer_api/api/test_api_version.py | 4 ++-- requirements.txt | 1 + 11 files changed, 21 insertions(+), 15 deletions(-) diff --git a/freezer_tempest_plugin/common.py b/freezer_tempest_plugin/common.py index 7b60292..6cb4c77 100644 --- a/freezer_tempest_plugin/common.py +++ b/freezer_tempest_plugin/common.py @@ -16,7 +16,6 @@ import distutils.spawn import hashlib import itertools -import json import os import random import shutil @@ -26,6 +25,8 @@ import unittest import paramiko +from oslo_serialization import jsonutils as json + from six.moves import range FREEZERC = distutils.spawn.find_executable('freezer-agent') diff --git a/freezer_tempest_plugin/tests/freezer/agent/base.py b/freezer_tempest_plugin/tests/freezer/agent/base.py index fef9637..7accf82 100644 --- a/freezer_tempest_plugin/tests/freezer/agent/base.py +++ b/freezer_tempest_plugin/tests/freezer/agent/base.py @@ -14,7 +14,6 @@ from datetime import datetime from datetime import timedelta -import json import os import subprocess @@ -22,6 +21,8 @@ from time import mktime from tempest import test +from oslo_serialization import jsonutils as json + from freezer_tempest_plugin.common import Temp_Tree diff --git a/freezer_tempest_plugin/tests/freezer/agent/test_backup_compress.py b/freezer_tempest_plugin/tests/freezer/agent/test_backup_compress.py index de8f8eb..170c5fc 100644 --- a/freezer_tempest_plugin/tests/freezer/agent/test_backup_compress.py +++ b/freezer_tempest_plugin/tests/freezer/agent/test_backup_compress.py @@ -12,12 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -import json import os import subprocess from tempest.lib import decorators +from oslo_serialization import jsonutils as json + from freezer_tempest_plugin import common from freezer_tempest_plugin.tests.freezer.agent import base diff --git a/freezer_tempest_plugin/tests/freezer/scenario/test_backups.py b/freezer_tempest_plugin/tests/freezer/scenario/test_backups.py index 83a4cdc..cfd0feb 100644 --- a/freezer_tempest_plugin/tests/freezer/scenario/test_backups.py +++ b/freezer_tempest_plugin/tests/freezer/scenario/test_backups.py @@ -13,7 +13,6 @@ # under the License. import hashlib -import json import os import shutil import tempfile @@ -22,6 +21,8 @@ import time from tempest.lib.cli import base as cli_base from tempest.lib.cli import output_parser +from oslo_serialization import jsonutils as json + from freezer_tempest_plugin.tests.freezer.agent import base JOB_TABLE_RESULT_COLUMN = 3 diff --git a/freezer_tempest_plugin/tests/freezer_api/api/test_api_actions.py b/freezer_tempest_plugin/tests/freezer_api/api/test_api_actions.py index 592f209..257be16 100644 --- a/freezer_tempest_plugin/tests/freezer_api/api/test_api_actions.py +++ b/freezer_tempest_plugin/tests/freezer_api/api/test_api_actions.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -import json - from tempest.lib import decorators from tempest.lib import exceptions +from oslo_serialization import jsonutils as json + from freezer_tempest_plugin.tests.freezer_api.api import base diff --git a/freezer_tempest_plugin/tests/freezer_api/api/test_api_backups.py b/freezer_tempest_plugin/tests/freezer_api/api/test_api_backups.py index 5bd5948..d40e315 100644 --- a/freezer_tempest_plugin/tests/freezer_api/api/test_api_backups.py +++ b/freezer_tempest_plugin/tests/freezer_api/api/test_api_backups.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -import json - import tempest from tempest.lib import decorators +from oslo_serialization import jsonutils as json + from freezer_tempest_plugin.tests.freezer_api.api import base diff --git a/freezer_tempest_plugin/tests/freezer_api/api/test_api_clients.py b/freezer_tempest_plugin/tests/freezer_api/api/test_api_clients.py index d075755..adacf54 100644 --- a/freezer_tempest_plugin/tests/freezer_api/api/test_api_clients.py +++ b/freezer_tempest_plugin/tests/freezer_api/api/test_api_clients.py @@ -12,12 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -import json import time from tempest.lib import decorators from tempest.lib import exceptions +from oslo_serialization import jsonutils as json + from freezer_tempest_plugin.tests.freezer_api.api import base diff --git a/freezer_tempest_plugin/tests/freezer_api/api/test_api_jobs.py b/freezer_tempest_plugin/tests/freezer_api/api/test_api_jobs.py index e08a33e..312b0aa 100644 --- a/freezer_tempest_plugin/tests/freezer_api/api/test_api_jobs.py +++ b/freezer_tempest_plugin/tests/freezer_api/api/test_api_jobs.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -import json - from tempest.lib import decorators from tempest.lib import exceptions +from oslo_serialization import jsonutils as json + from freezer_tempest_plugin.tests.freezer_api.api import base fake_job = { diff --git a/freezer_tempest_plugin/tests/freezer_api/api/test_api_sessions.py b/freezer_tempest_plugin/tests/freezer_api/api/test_api_sessions.py index e298414..0981be2 100644 --- a/freezer_tempest_plugin/tests/freezer_api/api/test_api_sessions.py +++ b/freezer_tempest_plugin/tests/freezer_api/api/test_api_sessions.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. -import json - from tempest.lib import decorators from tempest.lib import exceptions +from oslo_serialization import jsonutils as json + from freezer_tempest_plugin.tests.freezer_api.api import base diff --git a/freezer_tempest_plugin/tests/freezer_api/api/test_api_version.py b/freezer_tempest_plugin/tests/freezer_api/api/test_api_version.py index 8f73734..1ed0680 100644 --- a/freezer_tempest_plugin/tests/freezer_api/api/test_api_version.py +++ b/freezer_tempest_plugin/tests/freezer_api/api/test_api_version.py @@ -12,10 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -import json - from tempest.lib import decorators +from oslo_serialization import jsonutils as json + from freezer_tempest_plugin.tests.freezer_api.api import base diff --git a/requirements.txt b/requirements.txt index eab1f3a..7ad2f43 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ # process, which may cause wedges in the gate later. pbr!=2.1.0,>=2.0.0 # Apache-2.0 +oslo.serialization>=2.25.0 # Apache-2.0 oslo.utils>=3.33.0 # Apache-2.0 oslo.config>=5.2.0 # Apache-2.0 paramiko>=2.0.0 # LGPLv2.1+