summaryrefslogtreecommitdiff
path: root/python/qpid/driver.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-02-17 20:21:10 +0000
committerRafael H. Schloming <rhs@apache.org>2010-02-17 20:21:10 +0000
commit3add7d150984e7904acf0898cab8cb7941de27ba (patch)
treeeab8ccb38569a22551c0ed4c9f81c93b8a96fb75 /python/qpid/driver.py
parentc3b903579b10d3eaaad41a0f9b5351fa955f2528 (diff)
downloadqpid-python-3add7d150984e7904acf0898cab8cb7941de27ba.tar.gz
fixed subject defaulting and added test
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@911166 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/driver.py')
-rw-r--r--python/qpid/driver.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/python/qpid/driver.py b/python/qpid/driver.py
index 3b9d7aa9fa..ed6fbc3b6a 100644
--- a/python/qpid/driver.py
+++ b/python/qpid/driver.py
@@ -950,6 +950,12 @@ class Driver:
rk = _snd._routing_key
else:
rk = msg.subject
+
+ if msg.subject is None:
+ subject = _snd.subject
+ else:
+ subject = msg.subject
+
# XXX: do we need to query to figure out how to create the reply-to interoperably?
if msg.reply_to:
rt = addr2reply_to(msg.reply_to)
@@ -962,10 +968,10 @@ class Driver:
correlation_id=msg.correlation_id,
content_type=msg.content_type,
application_headers=msg.properties)
- if msg.subject is not None:
+ if subject is not None:
if mp.application_headers is None:
mp.application_headers = {}
- mp.application_headers[SUBJECT] = msg.subject
+ mp.application_headers[SUBJECT] = subject
if msg.to is not None:
if mp.application_headers is None:
mp.application_headers = {}