Replace jsonutils by ujson

ujson is faster than jsonutils, and we do not need any fancy feature jsonutils
might offer.

Change-Id: I2d8e70da055777d58ca5e6718458dd5dcf294747
This commit is contained in:
Everett 2017-11-21 14:47:20 -05:00
parent 18e01ab9d8
commit cccb41bd71
3 changed files with 5 additions and 5 deletions

View File

@ -12,8 +12,8 @@
"""Start FlexVolume driver of Cinder"""
from oslo_serialization import jsonutils
import sys
import ujson
from fuxi_kubernetes.common import constants
from fuxi_kubernetes.flex_volume_drivers.drivers.cinder import cinder
@ -27,5 +27,5 @@ def main():
"""
result = cinder.DriverCinder()(sys.argv[1:])
print(jsonutils.dumps(result()))
print(ujson.dumps(result()))
sys.exit((0 if result.status == constants.STATUS_SUCCESS else 1))

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_serialization import jsonutils
import requests
import ujson
from fuxi_kubernetes.common import constants
from fuxi_kubernetes import exceptions
@ -130,7 +130,7 @@ class BaseVolumeDriver(object):
def _load_json_param(data):
try:
return jsonutils.loads(data)
return ujson.loads(data)
except Exception:
raise exceptions.InvalidVolumeDriverCmdParameter(
"can not load json parameter:(%s)" % data)

View File

@ -3,9 +3,9 @@
# process, which may cause wedges in the gate later.
pbr!=2.1.0,>=2.0.0 # Apache-2.0
oslo.serialization>=1.10.0 # Apache-2.0
os-brick>=1.15.2 # Apache-2.0
python-cinderclient>=3.1.0 # Apache-2.0
stevedore>=1.20.0 # Apache-2.0
Flask!=0.11,<1.0,>=0.10 # BSD
kuryr-lib>=0.5.0 # Apache-2.0
ujson