Update json module to jsonutils

oslo project provide jsonutils, and tacker use it in many place[1],
this PS to update the remained json module to oslo jsonutils for
consistency.

[1]: https://github.com/openstack/tacker/search?q=jsonutils&unscoped_q=jsonutils

Change-Id: I7254f80bab9cfb9fed0f1e7841003dea47aec9e7
This commit is contained in:
caoyuan 2019-02-27 23:26:41 +08:00
parent 5e01931264
commit 8897f282fc
4 changed files with 7 additions and 8 deletions

View File

@ -45,7 +45,7 @@ oslo.config==5.2.0
oslo.context==2.22.0
oslo.i18n==3.20.0
oslo.log==3.36.0
oslo.serialization==2.25.0
oslo.serialization==2.18.0
oslo.utils==3.36.0
oslosphinx==4.7.0
packaging==17.1

View File

@ -8,6 +8,7 @@
#
# PBR should always appear first
oslo.log>=3.36.0 # Apache-2.0
oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
pbr!=2.1.0,>=2.0.0 # Apache-2.0
python-tackerclient>=0.8.0 # Apache-2.0

View File

@ -10,12 +10,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from oslo_log import log as logging
from oslo_serialization import jsonutils
from horizon import exceptions
from horizon import forms
@ -93,7 +92,7 @@ class DetailView(tabs.TabView):
try:
vnffg = tacker_api.tacker.get_vnffg(self.request, vnffg_id)
vnffg["vnffg"]["mgmt_url"] = json.loads(
vnffg["vnffg"]["mgmt_url"] = jsonutils.loads(
vnffg["vnffg"]["mgmt_url"]) if vnffg["vnffg"].get(
"mgmt_url") else None
return vnffg

View File

@ -12,12 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from oslo_log import log as logging
from oslo_serialization import jsonutils
from horizon import exceptions
from horizon import forms
@ -95,8 +94,8 @@ class DetailView(tabs.TabView):
try:
vnf = tacker_api.tacker.get_vnf(self.request, vnf_id)
vnf["vnf"]["mgmt_url"] = json.loads(vnf["vnf"]["mgmt_url"]) if \
vnf["vnf"]["mgmt_url"] else None
vnf["vnf"]["mgmt_url"] = jsonutils.loads(vnf["vnf"]["mgmt_url"]) \
if vnf["vnf"]["mgmt_url"] else None
return vnf
except ValueError as e:
msg = _('Cannot decode json : %s') % e