summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-08-23 09:36:56 -0700
committerBen Pfaff <blp@nicira.com>2011-08-24 11:57:43 -0700
commitc29e06be0e224f1c2392e892016bd6b80749611d (patch)
tree808cefc74e418aa369a8d72b62372a44f52309b7 /python
parentbf6ec045b7dacb243347a5b84d4c3cff466d6528 (diff)
downloadopenvswitch-c29e06be0e224f1c2392e892016bd6b80749611d.tar.gz
ovs.db.parser: Simplify code.
Suggested-by: Reid Price <reid@nicira.com>
Diffstat (limited to 'python')
-rw-r--r--python/ovs/db/parser.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/python/ovs/db/parser.py b/python/ovs/db/parser.py
index 67b3bd53c..173922bab 100644
--- a/python/ovs/db/parser.py
+++ b/python/ovs/db/parser.py
@@ -53,15 +53,13 @@ class Parser(object):
if missing:
name = missing.pop()
if len(missing) > 1:
- self.__raise_error("Member '%s' and %d other members "
- "are present but not allowed here"
- % (name, len(missing)))
+ present = "and %d other members are" % len(missing)
elif missing:
- self.__raise_error("Member '%s' and 1 other member "
- "are present but not allowed here" % name)
+ present = "and 1 other member are"
else:
- self.__raise_error("Member '%s' is present but not "
- "allowed here" % name)
+ present = "is"
+ self.__raise_error("Member '%s' %s present but not allowed here" %
+ (name, present))
def float_to_int(x):
# XXX still needed?