Update json module to jsonutils
oslo project provide jsonutils, the others project use it this PS to update the json moudule to oslo jsonutils. Change-Id: I311d4f9dec7b685a5bccb9725de6010926375c7d
This commit is contained in:
parent
8ba1629235
commit
789f7c3e16
|
@ -22,8 +22,8 @@ import ast
|
|||
import datetime
|
||||
import functools
|
||||
import inspect
|
||||
import json
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import strutils
|
||||
from oslo_utils import timeutils
|
||||
import pecan
|
||||
|
@ -225,5 +225,5 @@ class JsonType(wtypes.UserType):
|
|||
@staticmethod
|
||||
def validate(value):
|
||||
# check that value can be serialised
|
||||
json.dumps(value)
|
||||
jsonutils.dumps(value)
|
||||
return value
|
||||
|
|
|
@ -19,10 +19,9 @@ response with one formatted so the client can parse it.
|
|||
Based on pecan.middleware.errordocument
|
||||
"""
|
||||
|
||||
import json
|
||||
|
||||
from lxml import etree
|
||||
from oslo_log import log
|
||||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
import webob
|
||||
|
||||
|
@ -109,13 +108,13 @@ class ParsableErrorMiddleware(object):
|
|||
if six.PY3:
|
||||
app_data = app_data.decode('utf-8')
|
||||
try:
|
||||
fault = json.loads(app_data)
|
||||
fault = jsonutils.loads(app_data)
|
||||
if error is not None and 'faultstring' in fault:
|
||||
fault['faultstring'] = i18n.translate(error,
|
||||
user_locale)
|
||||
except ValueError as err:
|
||||
fault = app_data
|
||||
body = json.dumps({'error_message': fault})
|
||||
body = jsonutils.dumps({'error_message': fault})
|
||||
if six.PY3:
|
||||
body = body.encode('utf-8')
|
||||
|
||||
|
|
|
@ -11,13 +11,14 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""Various HBase helpers"""
|
||||
|
||||
import copy
|
||||
import datetime
|
||||
import json
|
||||
|
||||
import bson.json_util
|
||||
from happybase.hbase import ttypes
|
||||
from oslo_log import log
|
||||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
|
||||
from panko.i18n import _
|
||||
|
@ -211,11 +212,11 @@ def serialize_entry(data=None, **kwargs):
|
|||
|
||||
|
||||
def dump(data):
|
||||
return json.dumps(data, default=bson.json_util.default)
|
||||
return jsonutils.dumps(data, default=bson.json_util.default)
|
||||
|
||||
|
||||
def load(data):
|
||||
return json.loads(data, object_hook=object_hook)
|
||||
return jsonutils.loads(data, object_hook=object_hook)
|
||||
|
||||
|
||||
# We don't want to have tzinfo in decoded json.This object_hook is
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
"""
|
||||
SQLAlchemy models for Panko data.
|
||||
"""
|
||||
import json
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
import six
|
||||
import sqlalchemy
|
||||
|
@ -36,13 +37,13 @@ class JSONEncodedDict(TypeDecorator):
|
|||
@staticmethod
|
||||
def process_bind_param(value, dialect):
|
||||
if value is not None:
|
||||
value = json.dumps(value)
|
||||
value = jsonutils.dumps(value)
|
||||
return value
|
||||
|
||||
@staticmethod
|
||||
def process_result_value(value, dialect):
|
||||
if value is not None:
|
||||
value = json.loads(value)
|
||||
value = jsonutils.loads(value)
|
||||
return value
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ PasteDeploy>=1.5.0 # MIT
|
|||
pbr>=2.0.0 # Apache-2.0
|
||||
pecan>=1.0.0 # BSD
|
||||
oslo.middleware>=3.10.0 # Apache-2.0
|
||||
oslo.serialization>=2.25.0 # Apache-2.0
|
||||
oslo.utils>=3.5.0 # Apache-2.0
|
||||
PyYAML>=3.1.0 # MIT
|
||||
six>=1.9.0 # MIT
|
||||
|
|
Loading…
Reference in New Issue