You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2015/02/17 22:56:37 UTC

svn commit: r1660512 - in /qpid/dispatch/trunk: python/qpid_dispatch/management/client.py tests/system_test.py

Author: aconway
Date: Tue Feb 17 21:56:37 2015
New Revision: 1660512

URL: http://svn.apache.org/r1660512
Log:
DISPATCH-116: Managment clients and tests use anonymous@ to trigger SASL connection by proton.

Recent changes in proton mean that by default it does no SASL handshake on connection.
Dispatch requires SASL, using "anonymous@" in the connection URL for proton triggers
the SASL handshake.

Modified:
    qpid/dispatch/trunk/python/qpid_dispatch/management/client.py
    qpid/dispatch/trunk/tests/system_test.py

Modified: qpid/dispatch/trunk/python/qpid_dispatch/management/client.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch/management/client.py?rev=1660512&r1=1660511&r2=1660512&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch/management/client.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch/management/client.py Tue Feb 17 21:56:37 2015
@@ -86,13 +86,19 @@ class Node(object):
         self.name = self.identity = 'self'
         self.type = 'org.amqp.management' # AMQP management node type
         self.url = Url(url).defaults()
+
+        # Dispatch requires SASL, default to anonymous user to trigger ANONYMOUS mechanism.
+        # FIXME aconway 2015-02-17: this may change when proton SASL support is implemented.
+        if not self.url.username:
+            self.url.username = "anonymous"
+
         self.locales = locales
         if self.url.path is None:
             if router:
                 self.url.path = '_topo/0/%s/$management' % router
             else:
                 self.url.path = '$management'
-        connection = connection or BlockingConnection(url, timeout)
+        connection = connection or BlockingConnection(self.url, timeout)
         self.client = SyncRequestResponse(connection, self.url.path)
         self.reply_to = self.client.reply_to
 

Modified: qpid/dispatch/trunk/tests/system_test.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/tests/system_test.py?rev=1660512&r1=1660511&r2=1660512&view=diff
==============================================================================
--- qpid/dispatch/trunk/tests/system_test.py (original)
+++ qpid/dispatch/trunk/tests/system_test.py Tue Feb 17 21:56:37 2015
@@ -369,7 +369,7 @@ class Qdrouterd(Process):
     @property
     def addresses(self):
         """Return amqp://host:port addresses for all listeners"""
-        return ["amqp://%s:%s"%(l['addr'], l['port']) for l in self.config.sections('listener')]
+        return ["amqp://anonymous@%s:%s"%(l['addr'], l['port']) for l in self.config.sections('listener')]
 
     @property
     def hostports(self):
@@ -478,7 +478,7 @@ class Qpidd(Process):
     def wait_ready(self):
         wait_port(self.port)
 
-class Messenger(proton.Messenger): # pylint: disable=too-many-public-methods
+class Messenger(proton.Messenger):
     """Convenience additions to proton.Messenger"""
 
     def __init__(self, name=None, timeout=DEFAULT_TIMEOUT, blocking=True):



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org