Ben Pfaff
9e4f0157ec
ovs.db.data: Make Datum.check_constraints() work.
...
This code never got tested and so didn't work.
This does not fix an actual bug because Datum.check_constraints() does not
have any existing users.
2011-09-23 09:10:44 -07:00
Ben Pfaff
cf5404f67d
ovs.db.data: Fix Atom.new()'s handling of Boolean values.
...
Boolean values have Boolean type, not real type.
This does not fix an actual bug because Atom.new() does not have existing
users.
2011-09-23 09:10:44 -07:00
Ben Pfaff
169390eed0
ovs.json: Remove commented-out debug code.
...
This must have slipped into an old commit by accident.
2011-09-23 09:10:44 -07:00
Ben Pfaff
cba641035b
ovs.json: Actually implement the "pretty" option for serialization.
2011-09-23 09:10:44 -07:00
Ben Pfaff
9b46cccc33
python: Avoid shadowing standard or global names.
...
Found by pychecker.
2011-09-23 09:10:44 -07:00
Ben Pfaff
28c781df8a
python: Avoid "unused parameter" warnings from pychecker.
...
pychecker ignores parameters named "_" or prefixed with "unused_".
2011-09-23 09:10:43 -07:00
Ben Pfaff
14cd095f26
ovs.db.types: Always initialize ref_type attribute.
...
The ref_type attribute was initialized on some paths but not others.
Found by pychecker.
2011-09-23 09:10:43 -07:00
Ethan Jackson
2a8859b0a4
daemon.py: Silence return warning.
...
Pychecker complains about __read_pidfile() having too may returns.
I personally think the function is fine, but it's easy enough to
reduce them.
python/ovs/daemon.py:395: Function (__read_pidfile) has too many
returns (12)
2011-09-16 18:27:33 -07:00
Ethan Jackson
591c20651f
daemon.py: Don't shadow built-in 'file' variable.
...
Pychecker considers it bad style.
2011-09-16 18:27:33 -07:00
Ethan Jackson
cadc9871c2
daemon.py: Whitespace cleanup.
...
The python style guide requires two newlines between top level
definitions. This patch also removes some trailing whitespace.
2011-09-16 16:03:31 -07:00
Ben Pfaff
44852fdf63
Mark "uninstall-local" targets phony.
2011-09-15 11:19:59 -07:00
Ben Pfaff
54658e6169
ovs.db.types: Remove write-only variable from constraintsToEnglish().
...
Found by pychecker.
2011-08-25 11:07:23 -07:00
Ben Pfaff
973d7411d6
python: Remove unused imports.
...
Found by pychecker.
2011-08-25 11:07:23 -07:00
Ben Pfaff
1f00acd0bc
ovs.stream: Remove unused parameter from usage().
...
This function has no callers. We could delete it entirely, instead.
2011-08-25 11:07:23 -07:00
Ben Pfaff
fecf78c237
ovs.ovsuuid: Fix UUID.cInitUUID invocation of re.match with too few params.
...
Found by pychecker.
2011-08-25 11:07:23 -07:00
Ben Pfaff
4071e24db4
ovs.jsonrpc: Fix static method Session.open() reference to 'self'.
...
Found by pychecker.
2011-08-25 11:07:23 -07:00
Ben Pfaff
b2a5856fef
ovs.jsonrpc: Fix static method Message.__validate_arg reference to 'self'.
...
This method needs to be an instance method because it refers to 'self'.
Found by pychecker.
2011-08-25 11:07:23 -07:00
Ben Pfaff
6732237bee
ovs.json: Use Exception, which exists, instead of Error, which doesn't.
...
Found by pychecker.
2011-08-25 11:07:23 -07:00
Ben Pfaff
7550c333d3
ovs.db.idl: Fix error message format arguments.
...
There's no variable table_name.
Found by pychecker.
2011-08-25 11:07:23 -07:00
Ben Pfaff
c6b24dd7cd
ovs.daemon: Add missing format string argument.
...
Found by pychecker.
2011-08-25 11:07:23 -07:00
Ben Pfaff
0003748f58
ovs.daemon: Fix name of EALREADY error.
...
Found by pychecker.
2011-08-25 11:07:22 -07:00
Ben Pfaff
dbad9de126
ovs.daemon: Add missing 'global' when setting _pidfile_dev, _pidfile_ino.
...
Found by pychecker.
2011-08-25 11:07:22 -07:00
Ben Pfaff
af1eba26c3
ovs.db.idl: Fix call to ovs.db.parser.Parser constructor.
...
This bug was introduced by commit 4c0f62718f "ovs.db.idl: Improve error
reporting for bad <row-update>s."
Found by pychecker.
Bug #7006 .
2011-08-25 11:06:53 -07:00
Ben Pfaff
367da73833
python: Use enumerate() builtin function to simplify counted iteration.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:53 -07:00
Ben Pfaff
8ba31bf16d
ovs.stream: Simplify logic in Stream.wait().
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:53 -07:00
Ben Pfaff
63b1a52133
ovs.stream: Drop Stream.get_name() since clients can use 'name' directly.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:53 -07:00
Ben Pfaff
1f9dd59cf1
ovs.stream: Use %d in place of %ld since the two are equivalent in Python.
...
Reported-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:53 -07:00
Ben Pfaff
90d9dcfc12
ovs.reconnect: Fix typo in documentation.
...
Reported-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:52 -07:00
Ben Pfaff
0a61b042a5
ovs.reconnect: Make Reconnect.Reconnect inherit from object.
...
Reported-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:52 -07:00
Ben Pfaff
2ad4ef8920
ovs.jsonrpc: Use "not X" in place of "len(X) == 0" for testing strings.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:52 -07:00
Ben Pfaff
22bb61e9ee
ovs.jsonrpc: Remove Connection.get_name()--clients can use 'name' directly.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:52 -07:00
Ben Pfaff
17af143600
ovs.jsonrpc: Remove dead class variable Message.__next_id.
...
Reported-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:52 -07:00
Ben Pfaff
e0b2332760
ovs.json: Optimize __dump_string().
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 12:05:13 -07:00
Ben Pfaff
32fcdd44c5
ovs.fatal_signal: Remove unnecessary "global" statement.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:44 -07:00
Ben Pfaff
1304578aeb
ovs.fatal_signal: Reorder definitions to be more easily readable.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:44 -07:00
Ben Pfaff
71607f575e
ovs.db.types: Introduce DEFAULT_MIN, DEFAULT_MAX as Type class members.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:44 -07:00
Ben Pfaff
ca2c5d3d32
ovs.db.types: Use toAtomicType() instead of open-coding it.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:43 -07:00
Ben Pfaff
f09aa106ee
ovs.db.types: Simplify code to avoid try/except case.
...
Also fixes a typo that caused one version of the error message to have a
hyphen and the other to have a space.
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:43 -07:00
Ben Pfaff
1a98f75260
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>
2011-08-24 11:57:43 -07:00
Ben Pfaff
693e5dc748
ovs.db.schema: Factor common checks for identifiers into new function.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:43 -07:00
Ben Pfaff
c29e06be0e
ovs.db.parser: Simplify code.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:43 -07:00
Ben Pfaff
bf6ec045b7
ovs.db.idl: Use top-level class to represent IDL rows.
...
According to Reid, there may be some disadvantages to having this class be
anonymous, for example, cannot do instance/typechecking, might be
allocating a new class for every row as well, which isn't the most memory
efficient.
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:43 -07:00
Ben Pfaff
7d48f8f8bd
ovs.db.idl: Actually use Idl.__modify_row()'s return value.
...
Idl.__parse_row_update() assumed that every change that the database server
sent down actually modified the database. This is generally true, but
since Idl.__modify_row() already returns whether there was a change, we
might as well use it.
Reported-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:43 -07:00
Ben Pfaff
4c0f62718f
ovs.db.idl: Improve error reporting for bad <row-update>s.
...
Strangely malformed <row-update>s could hypothetically get confusing error
message. Using the Parser class should avoid that.
Reported-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:43 -07:00
Ben Pfaff
6a6f8d1673
ovsdb-data: Simplify converting an OVSDB datum to JSON by reordering logic.
...
Putting the "map" case first avoids duplicate tests.
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:42 -07:00
Ben Pfaff
0233401f12
daemon: Stylistic improvement for __read_pidfile in Python implementation.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:42 -07:00
Ben Pfaff
a7675d4e56
daemon: Correct comment in Python implementation.
...
Reported-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:42 -07:00
Ben Pfaff
91c637960c
python: Avoid using 'tuple' as a variable name.
...
'tuple' is a Python built-in function, so it's best to avoid using it as a
variable name.
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:42 -07:00
Ben Pfaff
8758e8a373
python: Avoid using 'type' as a variable name.
...
'type' is a Python built-in function, so it's best to avoid using it as
a variable name.
Reported-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:42 -07:00
Ben Pfaff
d272c10ecd
python: Take advantage of Python "x < y < z" syntax.
...
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:42 -07:00