diff options
author | Alan Conway <aconway@apache.org> | 2012-01-25 18:48:31 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2012-01-25 18:48:31 +0000 |
commit | fe4d3dd164c2685cb7483c65e2e915f93d13e7e6 (patch) | |
tree | 5abc1eb5f6f593fc6eb23cbe176f2701116374ba /qpid/extras/qmf/src/py/qmf/console.py | |
parent | 4208d1a90f004a5ab72463e9c6d9f97a3a17d16e (diff) | |
download | qpid-python-fe4d3dd164c2685cb7483c65e2e915f93d13e7e6.tar.gz |
QPID-3603: Set connection.start client-properties argument from python.
The client-properties can be specified for old-API, new-API and
QMF connections.
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-3603-2@1235869 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/extras/qmf/src/py/qmf/console.py')
-rw-r--r-- | qpid/extras/qmf/src/py/qmf/console.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/qpid/extras/qmf/src/py/qmf/console.py b/qpid/extras/qmf/src/py/qmf/console.py index e8be643c0f..0de013647c 100644 --- a/qpid/extras/qmf/src/py/qmf/console.py +++ b/qpid/extras/qmf/src/py/qmf/console.py @@ -640,7 +640,7 @@ class Session: return "QMF Console Session Manager (brokers: %d)" % len(self.brokers) - def addBroker(self, target="localhost", timeout=None, mechanisms=None): + def addBroker(self, target="localhost", timeout=None, mechanisms=None, **connectArgs): """ Connect to a Qpid broker. Returns an object of type Broker. Will raise an exception if the session is not managing the connection and the connection setup to the broker fails. @@ -650,7 +650,7 @@ class Session: else: url = BrokerURL(target) broker = Broker(self, url.host, url.port, mechanisms, url.authName, url.authPass, - ssl = url.scheme == URL.AMQPS, connTimeout=timeout) + ssl = url.scheme == URL.AMQPS, connTimeout=timeout, **connectArgs) self.brokers.append(broker) return broker @@ -2240,7 +2240,8 @@ class Broker(Thread): self.typecode = typecode self.data = data - def __init__(self, session, host, port, authMechs, authUser, authPass, ssl=False, connTimeout=None): + def __init__(self, session, host, port, authMechs, authUser, authPass, + ssl=False, connTimeout=None, **connectArgs): """ Create a broker proxy and setup a connection to the broker. Will raise an exception if the connection fails and the session is not configured to retry connection setup (manageConnections = False). @@ -2274,7 +2275,7 @@ class Broker(Thread): self.amqpSessionId = "%s.%d.%d" % (platform.uname()[1], os.getpid(), Broker.nextSeq) Broker.nextSeq += 1 self.last_age_check = time() - + self.connectArgs = connectArgs # thread control self.setDaemon(True) self.setName("Thread for broker: %s:%d" % (host, port)) @@ -2426,7 +2427,8 @@ class Broker(Thread): else: connSock = sock self.conn = Connection(connSock, username=self.authUser, password=self.authPass, - mechanism = self.mechanisms, host=self.host, service="qpidd") + mechanism = self.mechanisms, host=self.host, service="qpidd", + **self.connectArgs) def aborted(): raise Timeout("Waiting for connection to be established with broker") oldAborted = self.conn.aborted |