mirror of
https://github.com/openvswitch/ovs
synced 2025-09-01 23:05:29 +00:00
ovs.db.parser: Simplify code.
Suggested-by: Reid Price <reid@nicira.com>
This commit is contained in:
@@ -53,15 +53,13 @@ class Parser(object):
|
|||||||
if missing:
|
if missing:
|
||||||
name = missing.pop()
|
name = missing.pop()
|
||||||
if len(missing) > 1:
|
if len(missing) > 1:
|
||||||
self.__raise_error("Member '%s' and %d other members "
|
present = "and %d other members are" % len(missing)
|
||||||
"are present but not allowed here"
|
|
||||||
% (name, len(missing)))
|
|
||||||
elif missing:
|
elif missing:
|
||||||
self.__raise_error("Member '%s' and 1 other member "
|
present = "and 1 other member are"
|
||||||
"are present but not allowed here" % name)
|
|
||||||
else:
|
else:
|
||||||
self.__raise_error("Member '%s' is present but not "
|
present = "is"
|
||||||
"allowed here" % name)
|
self.__raise_error("Member '%s' %s present but not allowed here" %
|
||||||
|
(name, present))
|
||||||
|
|
||||||
def float_to_int(x):
|
def float_to_int(x):
|
||||||
# XXX still needed?
|
# XXX still needed?
|
||||||
|
Reference in New Issue
Block a user