]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Consistently use jsonutils instead of specific implementation
authorIhar Hrachyshka <ihrachys@redhat.com>
Mon, 16 Jun 2014 07:17:10 +0000 (09:17 +0200)
committerIhar Hrachyshka <ihrachys@redhat.com>
Mon, 16 Jun 2014 07:18:52 +0000 (09:18 +0200)
jsonutils have several benefits in comparison to pure json
implementation, like enabling C boosted encoders and decoders for
Python2.6 by using simplejson when available.

Change-Id: I24d0cd442e8d9d89fac50e43fc97f7bb4a293c3d
Closes-Bug: 1329496

15 files changed:
neutron/plugins/bigswitch/servermanager.py
neutron/plugins/bigswitch/tests/test_server.py
neutron/plugins/nec/common/ofc_client.py
neutron/plugins/vmware/api_client/eventlet_request.py
neutron/plugins/vmware/nsxlib/__init__.py
neutron/plugins/vmware/nsxlib/l2gateway.py
neutron/plugins/vmware/nsxlib/lsn.py
neutron/plugins/vmware/nsxlib/secgroup.py
neutron/plugins/vmware/nsxlib/switch.py
neutron/tests/unit/bigswitch/fake_server.py
neutron/tests/unit/nec/test_ofc_client.py
neutron/tests/unit/test_policy.py
neutron/tests/unit/vmware/apiclient/fake.py
neutron/tests/unit/vmware/nsxlib/test_lsn.py
neutron/tests/unit/vmware/vshield/fake_vcns.py

index 74f18de3d2417dea080d843e57b6e986d52d35f8..5fda199977a09e56b469101d4659f30d5cde3665 100644 (file)
@@ -33,7 +33,6 @@ The following functionality is handled by this module:
 """
 import base64
 import httplib
-import json
 import os
 import socket
 import ssl
@@ -44,6 +43,7 @@ from oslo.config import cfg
 from neutron.common import exceptions
 from neutron.common import utils
 from neutron.openstack.common import excutils
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import log as logging
 from neutron.plugins.bigswitch.db import consistency_db as cdb
 
index ad06dde5d4eb928fc0ad121db0d6fd4e7178da7d..ee0c2be3dad6d1a6de375900fdcbaa79900796f5 100755 (executable)
@@ -24,12 +24,13 @@ Used for NeutronRestProxy tests
 """
 from __future__ import print_function
 
-import json
 import re
 
 from six import moves
 from wsgiref import simple_server
 
+from neutron.openstack.common import jsonutils as json
+
 
 class TestNetworkCtrl(object):
 
index d51738c7ac3a6809bc58d364077f4b3b4401115b..21fb5f74b889575f0ff58e400e2727fdc0230d14 100644 (file)
 #    under the License.
 # @author: Ryota MIBU
 
-import json
 import time
 
 import requests
 
 from neutron.openstack.common import excutils
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import log as logging
 from neutron.plugins.nec.common import config
 from neutron.plugins.nec.common import exceptions as nexc
index 9470db2352abf66b690f9069e3fb0ec505bce126..26c378e0c41dc476ccc74ec6ceddc405c810b2b6 100644 (file)
@@ -16,9 +16,9 @@
 
 import eventlet
 import httplib
-import json
 import urllib
 
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import log as logging
 from neutron.plugins.vmware.api_client import request
 
index 738246bbb5376618400ee8134554f3bc51dfb40a..b09460b59392bf620ecc3f331c0e3fed821e07ea 100644 (file)
@@ -13,9 +13,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
-
 from neutron.common import exceptions as exception
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import log
 from neutron.plugins.vmware.api_client import exception as api_exc
 from neutron.plugins.vmware.common import exceptions as nsx_exc
index c0e761724e6e6f2d30671388da85f67c3490f5d1..bd261f9226556aca6cc2033818250c03b8e837e3 100644 (file)
@@ -14,8 +14,7 @@
 #    under the License.
 #
 
-import json
-
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import log
 from neutron.plugins.vmware.api_client import exception as api_exc
 from neutron.plugins.vmware.common import exceptions as nsx_exc
index 993f9d5bb70b0256e5df308f4ba06041946bedf1..f67288bf0bd2ca67cf61f31de567ffb78ad62d28 100644 (file)
@@ -15,9 +15,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
-
 from neutron.common import exceptions as exception
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import log
 from neutron.plugins.vmware.api_client import exception as api_exc
 from neutron.plugins.vmware.common import exceptions as nsx_exc
index fa4a10ef10f0dd14d73aa4e9bc70f53791d77b99..663a090c4cc4ef77422047269ffbdd1855b29bb9 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
-
 from neutron.common import constants
 from neutron.common import exceptions
 from neutron.openstack.common import excutils
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import log
 from neutron.plugins.vmware.common import utils
 from neutron.plugins.vmware import nsxlib
index f84e2f5846dfc9a9ff300a0a3057e6b7b5e75849..b344fa0eeaed60bc5070bd43be60209554a893ac 100644 (file)
 #    under the License.
 #
 
-import json
-
 from oslo.config import cfg
 
 from neutron.common import constants
 from neutron.common import exceptions as exception
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import log
 from neutron.plugins.vmware.api_client import exception as api_exc
 from neutron.plugins.vmware.common import exceptions as nsx_exc
index 2f65549bb3ae378e826c77a71a12556e5c5518eb..3db3cc3ed840062e9f0e18b13c922f2cb669c412 100644 (file)
@@ -17,8 +17,7 @@
 # @author: Kevin Benton, <kevin.benton@bigswitch.com>
 #
 
-import json
-
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import log as logging
 from neutron.plugins.bigswitch import servermanager
 
index 09a214a1f0fd5aa62776db5c152562feeecf4297..93f75a2b0429814f28c417a7dfb063f35606118e 100644 (file)
 #
 # @author: Akihiro Motoki
 
-import json
-
 import mock
 from oslo.config import cfg
 import requests
 
+from neutron.openstack.common import jsonutils as json
 from neutron.plugins.nec.common import config
 from neutron.plugins.nec.common import exceptions as nexc
 from neutron.plugins.nec.common import ofc_client
index f0b63df63d3fbf86a386d8f6be8b306976e8f338..a17ac9aeba364ae52aca23fa3f81464cb6561e67 100644 (file)
@@ -15,7 +15,6 @@
 
 """Test of Policy Engine For Neutron"""
 
-import json
 import urllib2
 
 import fixtures
@@ -28,6 +27,7 @@ from neutron.common import exceptions
 from neutron import context
 from neutron import manager
 from neutron.openstack.common import importutils
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import policy as common_policy
 from neutron import policy
 from neutron.tests import base
index 4d54a1824a3e1c2f0166d0164fae73d9795d690b..eb1f62f49324264d796c723fc2d90134104ff9c1 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
-
 import six.moves.urllib.parse as urlparse
 
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.plugins.vmware.api_client import exception as api_exc
index 385a74e35a110284fc3905d4faf6832798dacf9b..41c50b6c3be8f90fb4137d9332a27617c907f170 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import json
 import mock
 
 from neutron.common import exceptions
+from neutron.openstack.common import jsonutils as json
 from neutron.plugins.vmware.api_client import exception as api_exc
 from neutron.plugins.vmware.common import exceptions as nsx_exc
 from neutron.plugins.vmware.common import utils
index 37dcbf536571f07f1d39051c362885b91458cc3a..2c9aa6162fbb4650a508d86669369e88220cb578 100644 (file)
@@ -13,8 +13,8 @@
 #    under the License.
 
 import copy
-import json
 
+from neutron.openstack.common import jsonutils as json
 from neutron.openstack.common import uuidutils
 from neutron.plugins.vmware.vshield.common import exceptions