Pidbox: Don't declare when replying, also fix unicode with kwargs bug

This commit is contained in:
Ask Solem 2010-11-15 14:14:26 +01:00
parent e736b10058
commit 9de9f49cb6
1 changed files with 5 additions and 2 deletions

View File

@ -83,7 +83,9 @@ class Node(object):
reply = {"error": repr(exc)}
if reply_to:
self.reply({self.hostname: reply}, **reply_to)
self.reply({self.hostname: reply},
exchange=reply_to["exchange"],
routing_key=reply_to["routing_key"])
return reply
def handle(self, method, arguments={}):
@ -179,7 +181,8 @@ class Mailbox(object):
delivery_mode="transient",
durable=False,
auto_delete=True)
producer = Producer(chan, exchange=exchange)
producer = Producer(chan, exchange=exchange,
auto_declare=False)
producer.publish(reply, routing_key=routing_key)
finally:
channel or chan.close()