Merge "Janitorial: Catch rpc up with a change in common"

This commit is contained in:
Jenkins 2012-07-13 23:09:15 +00:00 committed by Gerrit Code Review
commit f4a778f31f
4 changed files with 11 additions and 10 deletions

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
from nova.openstack.common import cfg
from nova.openstack.common import jsonutils
from nova.openstack.common import log as logging
@ -31,4 +31,4 @@ def notify(_context, message):
priority = priority.lower()
logger = logging.getLogger(
'nova.openstack.common.notification.%s' % message['event_type'])
getattr(logger, priority)(json.dumps(message))
getattr(logger, priority)(jsonutils.dumps(message))

View File

@ -18,11 +18,11 @@ queues. Casts will block, but this is very useful for tests.
"""
import inspect
import json
import time
import eventlet
from nova.openstack.common import jsonutils
from nova.openstack.common.rpc import common as rpc_common
CONSUMERS = {}
@ -121,7 +121,7 @@ def create_connection(conf, new=True):
def check_serialize(msg):
"""Make sure a message intended for rpc can be serialized."""
json.dumps(msg)
jsonutils.dumps(msg)
def multicall(conf, context, topic, msg, timeout=None):

View File

@ -17,7 +17,6 @@
import functools
import itertools
import json
import logging
import time
import uuid
@ -29,6 +28,7 @@ import qpid.messaging.exceptions
from nova.openstack.common import cfg
from nova.openstack.common.gettextutils import _
from nova.openstack.common import jsonutils
from nova.openstack.common.rpc import amqp as rpc_amqp
from nova.openstack.common.rpc import common as rpc_common
@ -125,7 +125,7 @@ class ConsumerBase(object):
addr_opts["node"]["x-declare"].update(node_opts)
addr_opts["link"]["x-declare"].update(link_opts)
self.address = "%s ; %s" % (node_name, json.dumps(addr_opts))
self.address = "%s ; %s" % (node_name, jsonutils.dumps(addr_opts))
self.reconnect(session)
@ -230,7 +230,7 @@ class Publisher(object):
if node_opts:
addr_opts["node"]["x-declare"].update(node_opts)
self.address = "%s ; %s" % (node_name, json.dumps(addr_opts))
self.address = "%s ; %s" % (node_name, jsonutils.dumps(addr_opts))
self.reconnect(session)

View File

@ -14,8 +14,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
import pprint
import socket
import string
import sys
import types
@ -28,6 +28,7 @@ import greenlet
from nova.openstack.common import cfg
from nova.openstack.common.gettextutils import _
from nova.openstack.common import importutils
from nova.openstack.common import jsonutils
from nova.openstack.common.rpc import common as rpc_common
@ -76,7 +77,7 @@ def _serialize(data):
Error if a developer passes us bad data.
"""
try:
return str(json.dumps(data, ensure_ascii=True))
return str(jsonutils.dumps(data, ensure_ascii=True))
except TypeError:
LOG.error(_("JSON serialization failed."))
raise
@ -87,7 +88,7 @@ def _deserialize(data):
Deserialization wrapper
"""
LOG.debug(_("Deserializing: %s"), data)
return json.loads(data)
return jsonutils.loads(data)
class ZmqSocket(object):