summaryrefslogtreecommitdiff
path: root/python/examples/reservations/machine-agent
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-04-09 15:14:27 +0000
committerRafael H. Schloming <rhs@apache.org>2010-04-09 15:14:27 +0000
commit178f17b6a82df278116c026c7f67443cb92b52c2 (patch)
treedf45ccb15b8fe4212bbdf809aeb507f691d9f9c3 /python/examples/reservations/machine-agent
parentef958e7b221d38ec76c392f76a66978211d6d1f9 (diff)
downloadqpid-python-178f17b6a82df278116c026c7f67443cb92b52c2.tar.gz
updated reservations example to match latest changes
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@932454 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/examples/reservations/machine-agent')
-rwxr-xr-xpython/examples/reservations/machine-agent10
1 files changed, 2 insertions, 8 deletions
diff --git a/python/examples/reservations/machine-agent b/python/examples/reservations/machine-agent
index 9df663bdf5..a221a8b6de 100755
--- a/python/examples/reservations/machine-agent
+++ b/python/examples/reservations/machine-agent
@@ -20,7 +20,6 @@
import optparse, socket
from qpid.messaging import *
-from qpid.util import URL
from qpid.log import enable, DEBUG, WARN
from common import *
@@ -46,11 +45,7 @@ if opts.verbose:
else:
enable("qpid", WARN)
-url = URL(opts.broker)
-conn = Connection.open(url.host, url.port or AMQP_PORT,
- username=url.user, password=url.password,
- reconnect=True,
- reconnect_delay=1)
+conn = Connection.establish(opts.broker, reconnect=True, reconnect_interval=1)
class Agent(Dispatcher):
@@ -72,8 +67,7 @@ class Agent(Dispatcher):
def do_discover(self, msg):
r = self.get_status()
- r.to = msg.reply_to
- return [r]
+ return [(msg.reply_to, r)]
def do_reserve(self, msg):
if self.status == FREE: