2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

ovs.db.parser: Simplify code.

Suggested-by: Reid Price <reid@nicira.com>
This commit is contained in:
Ben Pfaff
2011-08-23 09:36:56 -07:00
parent bf6ec045b7
commit c29e06be0e

View File

@@ -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?