Update json module to jsonutils

json is deprecated, should use oslo_serialization.jsonutils
instead.

Change-Id: Ib4b562c3f37a5c133f3a6ae8efa00a26c8b41846
This commit is contained in:
zhulingjie 2019-02-21 00:20:08 +08:00
parent f8f1b59b7b
commit 63b5e271e4
16 changed files with 21 additions and 20 deletions

View File

@ -14,13 +14,13 @@
import abc
import json
import multiprocessing
import shutil
import tempfile
import time
from oslo_log import log
from oslo_serialization import jsonutils as json
import six
# PyCharm will not recognize queue. Puts red squiggle line under it. That's OK.
from six.moves import queue

View File

@ -18,13 +18,13 @@ import os
from oslo_config import cfg
from oslo_log import log
from oslo_serialization import jsonutils as json
from freezer.common import client_manager
from freezer.engine import engine
from freezer.engine.tar import tar
from freezer.utils import utils
import json
import tempfile
LOG = log.getLogger(__name__)

View File

@ -17,7 +17,6 @@ Freezer rsync incremental engine
import getpass
import grp
import json
import os
import pwd
import re
@ -26,6 +25,7 @@ import sys
import threading
from oslo_log import log
from oslo_serialization import jsonutils as json
from six.moves import cStringIO
from six.moves import queue

View File

@ -18,7 +18,6 @@
Freezer main execution function
"""
import json
import os
import prettytable
import subprocess
@ -26,6 +25,7 @@ import sys
from oslo_config import cfg
from oslo_log import log
from oslo_serialization import jsonutils as json
from oslo_utils import importutils
from freezer.common import client_manager

View File

@ -17,7 +17,6 @@
Freezer restore modes related functions
"""
import json
import os
import shutil
import tempfile
@ -25,6 +24,7 @@ import time
from oslo_config import cfg
from oslo_log import log
from oslo_serialization import jsonutils as json
from freezer.utils import utils

View File

@ -14,7 +14,6 @@
import datetime
import json
import os
import subprocess
import tempfile
@ -23,6 +22,7 @@ import time
from freezer.utils import utils
from oslo_config import cfg
from oslo_log import log
from oslo_serialization import jsonutils as json
from six.moves import configparser

View File

@ -13,13 +13,13 @@
# limitations under the License.
import json
import os
import signal
import socket
from freezerclient import exceptions
from oslo_log import log
from oslo_serialization import jsonutils as json
from oslo_utils import uuidutils
import psutil

View File

@ -15,10 +15,10 @@
import abc
import json
import tempfile
from oslo_log import log
from oslo_serialization import jsonutils as json
import six
from freezer.utils import utils

View File

@ -13,10 +13,10 @@
# limitations under the License.
import abc
import json
import six
from oslo_serialization import jsonutils as json
from freezer.storage import physical

View File

@ -16,7 +16,6 @@ limitations under the License.
"""
import ftplib
import json
import os
import shutil
import socket
@ -25,6 +24,7 @@ import tempfile
from freezer.storage import fslike
from freezer.utils import utils
from oslo_log import log
from oslo_serialization import jsonutils as json
CHUNK_SIZE = 32768
LOG = log.getLogger(__name__)

View File

@ -12,15 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import botocore
import botocore.session
import logging
import requests
from oslo_log import log
from oslo_serialization import jsonutils as json
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from freezer.storage import physical

View File

@ -16,7 +16,6 @@
import distutils.spawn
import hashlib
import itertools
import json
import os
import random
import shutil
@ -24,6 +23,8 @@ import subprocess
import tempfile
import unittest
from oslo_serialization import jsonutils as json
import paramiko
from six.moves import range
@ -295,7 +296,7 @@ class TestFS(unittest.TestCase):
def get_file_list_openstack(self, container):
if self.openstack_executable:
json_result = execute([self.openstack_executable, 'object', 'list',
container, '-f', json])
container, '-f', 'json'])
result = json.loads(json_result)
return [x['Name'] for x in result]
if self.swift_executable:

View File

@ -14,10 +14,10 @@
# ========================================================================
from copy import copy
import json
import os
import unittest
from oslo_serialization import jsonutils as json
from oslo_utils import uuidutils
from freezer.tests.integration import common

View File

@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import mock
import os
import ddt
from oslo_serialization import jsonutils as json
from freezer.engine.nova import nova
from freezer.tests import commons

View File

@ -13,10 +13,11 @@
# limitations under the License.
import ctypes
import json
import os
import sys
from oslo_serialization import jsonutils as json
def is_windows():
"""

View File

@ -11,6 +11,7 @@ python-keystoneclient>=3.8.0 # Apache-2.0
python-novaclient>=9.1.0 # Apache-2.0
python-neutronclient>=6.7.0 # Apache-2.0
python-freezerclient>=2.0.0 # Apache-2.0
oslo.serialization>=2.25.0 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0
oslo.config>=5.2.0 # Apache-2.0