summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-02-17 14:54:46 +0000
committerAlan Conway <aconway@apache.org>2012-02-17 14:54:46 +0000
commit0a8773c335509c2b9e9b96df360de190a266dcad (patch)
tree288469c17dacc37199b5f77498965fee7e778d95 /python
parentd82ce6836f7f0e4f7d647b2dc603141f549869d3 (diff)
downloadqpid-python-0a8773c335509c2b9e9b96df360de190a266dcad.tar.gz
QPID-3603: Merge new HA foundations.
Merged from qpid-3603-7. This is basic support for the new HA approach. For information & limitations see qpid/cpp/design_docs/new-ha-design.txt. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1245587 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/delegates.py6
-rw-r--r--python/qpid/messaging/driver.py5
-rw-r--r--python/qpid/messaging/endpoints.py1
3 files changed, 9 insertions, 3 deletions
diff --git a/python/qpid/delegates.py b/python/qpid/delegates.py
index 8dbdc37564..685cf49f54 100644
--- a/python/qpid/delegates.py
+++ b/python/qpid/delegates.py
@@ -159,7 +159,8 @@ class Client(Delegate):
def __init__(self, connection, username=None, password=None,
mechanism=None, heartbeat=None, **kwargs):
Delegate.__init__(self, connection)
-
+ self.client_properties=Client.PROPERTIES.copy()
+ self.client_properties.update(kwargs.get("client_properties",{}))
##
## self.acceptableMechanisms is the list of SASL mechanisms that the client is willing to
## use. If it's None, then any mechanism is acceptable.
@@ -215,7 +216,8 @@ class Client(Delegate):
mech = "ANONYMOUS"
if not mech in mech_list:
raise Closed("No acceptable SASL authentication mechanism available")
- ch.connection_start_ok(client_properties=Client.PROPERTIES, mechanism=mech, response=initial)
+ ch.connection_start_ok(client_properties=self.client_properties,
+ mechanism=mech, response=initial)
def connection_secure(self, ch, secure):
resp = None
diff --git a/python/qpid/messaging/driver.py b/python/qpid/messaging/driver.py
index dda5e38a61..0358659111 100644
--- a/python/qpid/messaging/driver.py
+++ b/python/qpid/messaging/driver.py
@@ -705,7 +705,10 @@ class Engine:
mech, initial = self._sasl.start(" ".join(mechs))
except sasl.SASLError, e:
raise AuthenticationFailure(text=str(e))
- self.write_op(ConnectionStartOk(client_properties=CLIENT_PROPERTIES,
+
+ client_properties = CLIENT_PROPERTIES.copy()
+ client_properties.update(self.connection.client_properties)
+ self.write_op(ConnectionStartOk(client_properties=client_properties,
mechanism=mech, response=initial))
def do_connection_secure(self, secure):
diff --git a/python/qpid/messaging/endpoints.py b/python/qpid/messaging/endpoints.py
index faa382a755..e632c0c5b8 100644
--- a/python/qpid/messaging/endpoints.py
+++ b/python/qpid/messaging/endpoints.py
@@ -170,6 +170,7 @@ class Connection(Endpoint):
self.ssl_keyfile = options.get("ssl_keyfile", None)
self.ssl_certfile = options.get("ssl_certfile", None)
self.ssl_trustfile = options.get("ssl_trustfile", None)
+ self.client_properties = options.get("client_properties", {})
self.options = options