Replacing ujson with simplejson
- http://lists.openstack.org/pipermail/openstack-discuss/2020-January/012285.html Change-Id: Ic18f8cf4addfedd9055999ec685e81140ffda32d
This commit is contained in:
parent
0447757f4e
commit
0f4e2bc5df
@ -48,6 +48,7 @@ requests==2.14.2
|
||||
requests-mock==1.2.0
|
||||
requestsexceptions==1.2.0
|
||||
rfc3986==0.3.1
|
||||
simplejson==3.13.2
|
||||
six==1.10.0
|
||||
smmap==0.9.0
|
||||
stestr==1.0.0
|
||||
@ -57,6 +58,5 @@ testrepository==0.0.18
|
||||
testscenarios==0.4
|
||||
testtools==2.2.0
|
||||
traceback2==1.4.0
|
||||
ujson==1.35
|
||||
unittest2==1.1.0
|
||||
wrapt==1.7.0
|
||||
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
import six
|
||||
import ujson as json
|
||||
import simplejson as json
|
||||
|
||||
from monasca_common.rest import exceptions
|
||||
|
||||
|
@ -410,7 +410,7 @@ class TestMetricValidation(base.BaseTestCase):
|
||||
metric_validator.InvalidValueMeta,
|
||||
"value combinations must be",
|
||||
metric_validator.validate, metric)
|
||||
# TODO: what would make ujson.dumps fail?
|
||||
# TODO: what would make json.dumps fail (simplejson)?
|
||||
|
||||
def test_invalid_timestamp(self):
|
||||
metric = {'name': 'test_metric_name',
|
||||
|
@ -18,7 +18,7 @@ import re
|
||||
|
||||
import six
|
||||
import sys
|
||||
import ujson
|
||||
import simplejson as json
|
||||
|
||||
# This is used to ensure that metrics with a timestamp older than
|
||||
# RECENT_POINT_THRESHOLD_DEFAULT seconds (or the value passed in to
|
||||
@ -108,7 +108,7 @@ def validate_value_meta(value_meta):
|
||||
raise InvalidValueMeta(msg)
|
||||
|
||||
try:
|
||||
value_meta_json = ujson.dumps(value_meta)
|
||||
value_meta_json = json.dumps(value_meta)
|
||||
except Exception:
|
||||
raise InvalidValueMeta("Unable to serialize valueMeta into JSON")
|
||||
if len(value_meta_json) > VALUE_META_VALUE_MAX_LENGTH:
|
||||
|
@ -8,5 +8,5 @@ oslo.config>=5.2.0 # Apache-2.0
|
||||
oslo.policy>=1.30.0 # Apache-2.0
|
||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
pyparsing>=2.1.0 # MIT
|
||||
ujson>=1.35 # BSD
|
||||
simplejson>=3.13.2 # MIT
|
||||
confluent-kafka>=0.11.4 # Apache-2.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user