qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tr...@apache.org
Subject svn commit: r1570596 - in /qpid/dispatch/trunk/python/qpid_dispatch_internal/router: data.py mobile.py
Date Fri, 21 Feb 2014 15:00:53 GMT
Author: tross
Date: Fri Feb 21 15:00:53 2014
New Revision: 1570596

URL: http://svn.apache.org/r1570596
Log:
DISPATCH-29 - Fixed incorrect usage of "if <list>:" in python router code.

Modified:
    qpid/dispatch/trunk/python/qpid_dispatch_internal/router/data.py
    qpid/dispatch/trunk/python/qpid_dispatch_internal/router/mobile.py

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/router/data.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/router/data.py?rev=1570596&r1=1570595&r2=1570596&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/router/data.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/router/data.py Fri Feb 21 15:00:53 2014
@@ -239,9 +239,9 @@ class MessageMAU(object):
         _add = ''
         _del = ''
         _exist = ''
-        if self.add_list:   _add   = ' add=%r'   % self.add_list
-        if self.del_list:   _del   = ' del=%r'   % self.del_list
-        if self.exist_list: _exist = ' exist=%r' % self.exist_list
+        if self.add_list != None:   _add   = ' add=%r'   % self.add_list
+        if self.del_list != None:   _del   = ' del=%r'   % self.del_list
+        if self.exist_list != None: _exist = ' exist=%r' % self.exist_list
         return "MAU(id=%s area=%s mobile_seq=%d%s%s%s)" % \
                 (self.id, self.area, self.mobile_seq, _add, _del, _exist)
 
@@ -249,9 +249,9 @@ class MessageMAU(object):
         body = { 'id'         : self.id,
                  'area'       : self.area,
                  'mobile_seq' : self.mobile_seq }
-        if self.add_list:   body['add']   = self.add_list
-        if self.del_list:   body['del']   = self.del_list
-        if self.exist_list: body['exist'] = self.exist_list
+        if self.add_list != None:   body['add']   = self.add_list
+        if self.del_list != None:   body['del']   = self.del_list
+        if self.exist_list != None: body['exist'] = self.exist_list
         return body
 
 

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/router/mobile.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/router/mobile.py?rev=1570596&r1=1570595&r2=1570596&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/router/mobile.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/router/mobile.py Fri Feb 21 15:00:53
2014
@@ -114,7 +114,7 @@ class MobileAddressEngine(object):
         if msg.id == self.id:
             return
 
-        if msg.exist_list:
+        if msg.exist_list != None:
             ##
             ## Absolute MAU
             ##
@@ -145,9 +145,9 @@ class MobileAddressEngine(object):
                         for addr in msg.del_list:
                             _list.remove(addr)
                     self.remote_lists[msg.id] = (msg.mobile_seq, _list)
-                    if msg.add_list:
+                    if msg.add_list != None:
                         self.node_tracker.add_addresses(msg.id, msg.add_list)
-                    if msg.del_list:
+                    if msg.del_list != None:
                         self.node_tracker.del_addresses(msg.id, msg.del_list)
                     self._activate_remotes(msg.id, msg.add_list, msg.del_list)
                 else:
@@ -181,10 +181,10 @@ class MobileAddressEngine(object):
 
     def _activate_remotes(self, _id, added, deleted):
         bit = self.node_tracker.maskbit_for_node(_id)
-        if added:
+        if added != None:
             for a in added:
                 self.container.router_adapter.map_destination(a, bit)
-        if deleted:
+        if deleted != None:
             for d in deleted:
                 self.container.router_adapter.unmap_destination(d, bit)
 



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


Mime
View raw message