Update json module to jsonutils

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

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

Change-Id: Id05dcc9de18fe1e594920843f79970e72bde940c
This commit is contained in:
cao.yuan 2019-02-25 19:25:21 +08:00
parent 0a27e534d8
commit a7eb48e314

View File

@ -16,10 +16,9 @@
"""Panko v2 event action implementations""" """Panko v2 event action implementations"""
import copy import copy
import json
from osc_lib.command import command from osc_lib.command import command
from osc_lib import utils from osc_lib import utils
from oslo_serialization import jsonutils
class EventList(command.Lister): class EventList(command.Lister):
@ -94,7 +93,7 @@ class EventShow(command.ShowOne):
ac = self.app.client_manager.event ac = self.app.client_manager.event
event = ac.event.get(message_id=parsed_args.message_id) event = ac.event.get(message_id=parsed_args.message_id)
data = copy.deepcopy(event._info) data = copy.deepcopy(event._info)
data.update({'traits': json.dumps(data['traits'], indent=4)}) data.update({'traits': jsonutils.dumps(data['traits'], indent=4)})
return self.dict2columns(data) return self.dict2columns(data)