From a7eb48e314d30ddc5bc627e6b9e0f5d99cbf31e8 Mon Sep 17 00:00:00 2001 From: "cao.yuan" Date: Mon, 25 Feb 2019 19:25:21 +0800 Subject: [PATCH] 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 --- pankoclient/v2/events_cli.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pankoclient/v2/events_cli.py b/pankoclient/v2/events_cli.py index 2dade81..aaf3ed2 100644 --- a/pankoclient/v2/events_cli.py +++ b/pankoclient/v2/events_cli.py @@ -16,10 +16,9 @@ """Panko v2 event action implementations""" import copy -import json - from osc_lib.command import command from osc_lib import utils +from oslo_serialization import jsonutils class EventList(command.Lister): @@ -94,7 +93,7 @@ class EventShow(command.ShowOne): ac = self.app.client_manager.event event = ac.event.get(message_id=parsed_args.message_id) 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)