ovs.db.types: Use .append instead of += for adding to lists.
authorBen Pfaff <blp@nicira.com>
Tue, 23 Aug 2011 21:00:54 +0000 (14:00 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 24 Aug 2011 18:57:43 +0000 (11:57 -0700)
Python does not do a good job of appending lists to lists.

Suggested-by: Reid Price <reid@nicira.com>
python/ovs/db/types.py

index 635922f506e2215e8b2d3b6155a1f5c12ffc0759..f7bc2482b1c5407707a72060d5007b2c6a89b670 100644 (file)
@@ -510,14 +510,14 @@ class Type(object):
         keyConstraints = self.key.constraintsToEnglish(escapeLiteral)
         if keyConstraints:
             if self.value:
-                constraints += ['key ' + keyConstraints]
+                constraints.append('key %s' % keyConstraints)
             else:
-                constraints += [keyConstraints]
+                constraints.append(keyConstraints)
 
         if self.value:
             valueConstraints = self.value.constraintsToEnglish(escapeLiteral)
             if valueConstraints:
-                constraints += ['value ' + valueConstraints]
+                constraints.append('value %s' % valueConstraints)
 
         return ', '.join(constraints)