get rid of anyjson in rpc and fix bad reference to rpc.Connection
This commit is contained in:
@@ -18,12 +18,12 @@ AMQP-based RPC. Queues have consumers and publishers.
|
||||
No fan-out support yet.
|
||||
"""
|
||||
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
from nova import vendor
|
||||
import anyjson
|
||||
from carrot import connection
|
||||
from carrot import messaging
|
||||
from twisted.internet import defer
|
||||
@@ -198,7 +198,7 @@ def send_message(topic, message, wait=True):
|
||||
_log.debug('message %s', message)
|
||||
|
||||
if wait:
|
||||
consumer = messaging.Consumer(connection=rpc.Connection.instance(),
|
||||
consumer = messaging.Consumer(connection=Connection.instance(),
|
||||
queue=msg_id,
|
||||
exchange=msg_id,
|
||||
auto_delete=True,
|
||||
@@ -206,7 +206,7 @@ def send_message(topic, message, wait=True):
|
||||
routing_key=msg_id)
|
||||
consumer.register_callback(generic_response)
|
||||
|
||||
publisher = messaging.Publisher(connection=rpc.Connection.instance(),
|
||||
publisher = messaging.Publisher(connection=Connection.instance(),
|
||||
exchange="nova",
|
||||
exchange_type="topic",
|
||||
routing_key=topic)
|
||||
@@ -219,4 +219,4 @@ def send_message(topic, message, wait=True):
|
||||
|
||||
# TODO: Replace with a docstring test
|
||||
if __name__ == "__main__":
|
||||
send_message(sys.argv[1], anyjson.deserialize(sys.argv[2]))
|
||||
send_message(sys.argv[1], json.loads(sys.argv[2]))
|
||||
|
||||
Reference in New Issue
Block a user