2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00
Commit Graph

8 Commits

Author SHA1 Message Date
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
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
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
f2d8ad13e1 python: Avoid lots of \" in quoted strings by using '' as outermost quotes.
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:42 -07:00
Ben Pfaff
523a3bc773 python: Use getattr() and setattr() instead of __dict__.
This leaves one use of __dict__ used for iterating through attributes.
I could use dir() instead, but I was put off by this note in its
documentation in the Python Library Reference:

    Because dir() is supplied primarily as a convenience for use at an
    interactive prompt, it tries to supply an interesting set of names more
    than it tries to supply a rigorously or consistently defined set of names,
    and its detailed behavior may change across releases.  For example,
    metaclass attributes are not in the result list when the argument is a
    class.

Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:42 -07:00
Ben Pfaff
991559357f Implement initial Python bindings for Open vSwitch database.
These initial bindings pass a few hundred of the corresponding tests
for C implementations of various bits of the Open vSwitch library API.
The poorest part of them is actually the Python IDL interface in
ovs.db.idl, which has not received enough attention yet.  It appears
to work, but it doesn't yet support writes (transactions) and it is
difficult to use.  I hope to improve it as it becomes clear what
semantics Python applications actually want from an IDL.
2010-08-25 14:55:48 -07:00