Fix content type for qpid notifier.
Fix bug 980872. This patch fixes a regression I introduced in2d36facf14
. In that patch, I adjusted the content_type for messages sent with the qpid notifier to be 'application/json' to match a change that went into the kombu notifier. Unfortunately, it's wrong. I assumed based on the kombu change that notifications were being json encoded before being passed into the notification driver. That's not the case. The message is a dict. So, just revert the change to set the content_type and let Qpid encode the notification as 'amqp/map'. (cherry picked from commit5bed23cbc9
) Change-Id: I8ba039612d9603377028ba72cb80ae89d675c741
This commit is contained in:
parent
98913da774
commit
5838b63903
|
@ -135,16 +135,13 @@ class QpidStrategy(strategy.Strategy):
|
|||
return self.session.sender(address)
|
||||
|
||||
def warn(self, msg):
|
||||
qpid_msg = qpid.messaging.Message(content=msg,
|
||||
content_type='application/json')
|
||||
qpid_msg = qpid.messaging.Message(content=msg)
|
||||
self.sender_warn.send(qpid_msg)
|
||||
|
||||
def info(self, msg):
|
||||
qpid_msg = qpid.messaging.Message(content=msg,
|
||||
content_type='application/json')
|
||||
qpid_msg = qpid.messaging.Message(content=msg)
|
||||
self.sender_info.send(qpid_msg)
|
||||
|
||||
def error(self, msg):
|
||||
qpid_msg = qpid.messaging.Message(content=msg,
|
||||
content_type='application/json')
|
||||
qpid_msg = qpid.messaging.Message(content=msg)
|
||||
self.sender_error.send(qpid_msg)
|
||||
|
|
|
@ -316,7 +316,7 @@ class TestQpidNotifier(unittest.TestCase):
|
|||
super(TestQpidNotifier, self).tearDown()
|
||||
|
||||
def _test_notify(self, priority):
|
||||
test_msg = json.dumps({'a': 'b'})
|
||||
test_msg = {'a': 'b'}
|
||||
|
||||
self.mock_connection = self.mocker.CreateMock(self.orig_connection)
|
||||
self.mock_session = self.mocker.CreateMock(self.orig_session)
|
||||
|
|
Loading…
Reference in New Issue