Repository: qpid-cpp
Updated Branches:
  refs/heads/master e37969a8c -> 88f105c93


QPID-8084: Change QMF client to use unicode string literals when encoding 
message application properties. Solves a Python 2 issue where the keys are 
encoded as binary rather as string types, which is contrarary to the AMQP 1.0 
spec.


Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/88f105c9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/88f105c9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/88f105c9

Branch: refs/heads/master
Commit: 88f105c93150ca25ebe2f45fb92565d547063951
Parents: e37969a
Author: Kim van der Riet <kvdr@localhost.localdomain>
Authored: Fri Feb 2 15:18:01 2018 -0500
Committer: Kim van der Riet <kvdr@localhost.localdomain>
Committed: Fri Feb 2 15:18:01 2018 -0500

----------------------------------------------------------------------
 management/python/lib/qmf/client.py | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/88f105c9/management/python/lib/qmf/client.py
----------------------------------------------------------------------
diff --git a/management/python/lib/qmf/client.py 
b/management/python/lib/qmf/client.py
index 89beaca..bab9e98 100644
--- a/management/python/lib/qmf/client.py
+++ b/management/python/lib/qmf/client.py
@@ -218,28 +218,28 @@ class BrokerAgent(object):
                     raise
 
     def _request(self, opcode, content):
-        props = {'method'             : 'request',
-                 'qmf.opcode'         : opcode,
-                 'x-amqp-0-10.app-id' : 'qmf2'}
+        props = {u'method'             : u'request',
+                 u'qmf.opcode'         : opcode,
+                 u'x-amqp-0-10.app-id' : u'qmf2'}
         return self._client.call(Message(body=content, properties=props, 
subject="broker"))
 
     def _method(self, method, arguments=None, 
addr="org.apache.qpid.broker:broker:amqp-broker"):
         """
-        Make a L{proton.Message} containining a QMF method request.
+        Make a L{proton.Message} containing a QMF method request.
         """
         content = {'_object_id'   : {'_object_name' : addr},
                    '_method_name' : method,
                    '_arguments'   : arguments or {}}
-        response = self._retry(self._request, '_method_request', content)
-        if response.properties['qmf.opcode'] == '_exception':
+        response = self._retry(self._request, u'_method_request', content)
+        if response.properties[u'qmf.opcode'] == u'_exception':
             raise Exception("management error: %r" % response.body['_values'])
-        if response.properties['qmf.opcode'] != '_method_response':
+        if response.properties[u'qmf.opcode'] != u'_method_response':
             raise Exception("bad response: %r" % response.properties)
         return response.body['_arguments']
 
     def _gather(self, response):
         items = response.body
-        while 'partial' in response.properties:
+        while u'partial' in response.properties:
             response = self._client.wait()
             items += self._client.wait(response.correlation_id).body
         return items
@@ -247,8 +247,8 @@ class BrokerAgent(object):
     def _classQuery(self, class_name):
         query = {'_what' : 'OBJECT', '_schema_id' : {'_class_name' : 
class_name}}
         def f():
-            response = self._request('_query_request', query)
-            if response.properties['qmf.opcode'] != '_query_response':
+            response = self._request(u'_query_request', query)
+            if response.properties[u'qmf.opcode'] != u'_query_response':
                 raise Exception("bad response")
             return self._gather(response)
         return self._retry(f)
@@ -256,8 +256,8 @@ class BrokerAgent(object):
     def _nameQuery(self, object_id):
         query = {'_what'      : 'OBJECT', '_object_id' : {'_object_name' : 
object_id}}
         def f():
-            response = self._request('_query_request', query)
-            if response.properties['qmf.opcode'] != '_query_response':
+            response = self._request(u'_query_request', query)
+            if response.properties[u'qmf.opcode'] != u'_query_response':
                 raise Exception("bad response")
             items = self._gather(response)
             if len(items) == 1:


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

Reply via email to