2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-29 15:28:56 +00:00

ovs.db.types: Use .append instead of += for adding to lists.

Python does not do a good job of appending lists to lists.

Suggested-by: Reid Price <reid@nicira.com>
This commit is contained in:
Ben Pfaff
2011-08-23 14:00:54 -07:00
parent 693e5dc748
commit 1a98f75260

View File

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