aboutsummaryrefslogtreecommitdiff
path: root/python/ovs
AgeCommit message (Collapse)Author
2012-11-21python/ovs/stream: Fix Stream.connect() retval for incomplete connection.Ben Pfaff
If the loop condition in Stream.connect() was false, which is especially likely for TCP connections, then Stream.connect() would return None, which violates its documented behavior. This commit fixes the problem. Reported-by: Isaku Yamahata <yamahata@valinux.co.jp> Tested-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-02python: Call 'wait' methods correctly in jsonrpc and stream code.Ben Pfaff
Bug #12301. Reported-by: Mike Kruze <mkruze@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-19ovsdb-doc: Use minus sign in negative numbers in nroff output.Ben Pfaff
ovs-vswitchd.conf.db.5 has autogenerated text "at least -1" in one place. This '-' should be a minus sign, but ovsdb-doc was generating it as a hyphen. Found by lintian. Reported-by: Thomas Goirand <zigo@debian.org> Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-11-28daemon: Better log when fork child dies early from signals.Ben Pfaff
On one machine, "/etc/init.d/openvswitch-switch start" failed to start with: ovs-vswitchd: fork child failed to signal startup (Success) Starting ovs-vswitchd ... failed! "strace" revealed that the fork child was actually segfaulting, but the message output didn't indicate that in any way. This commit fixes the log message (but not the segfault itself). Reported-by: Michael Hu <mhu@nicira.com> Bug #8457.
2011-11-18ovs-test: A new tool that allows to diagnose connectivity and performance issuesAnsis Atteka
This tool will be a replacement for the current ovs-vlan-test utility. Besides from connectivity issues it will also be able to detect performance related issues in Open vSwitch setups. Currently it uses UDP and TCP protocols for stressing. Issue #6976
2011-10-31ovsdb-idl: Prevent occasional hang when multiple database clients race.Ben Pfaff
When a client of the IDL tries to commit a read-modify-write transaction but the database has changed in the meantime, the IDL tells its client to wait for the IDL to change and then try the transaction again by returning TXN_TRY_AGAIN. The "wait for the IDL to change" part is important because there's no point in retrying the transaction before the IDL has received the database updates (the transaction would fail in the same way all over again). However, the logic was incomplete: the database update can be received *before* the reply to the transaction RPC (I think that in the current ovsdb-server implementation this will always happen, in fact). When this happens, the right thing to do is to retry the transaction immediately; if we wait, then we're waiting for an additional change to the database that may never come, causing an indefinite hang. This commit therefore breaks the "try again" IDL commit status code into two, one that means "try again immediately" and another that means "wait for a change then try again". When an update is processed after a transaction is committed but before the reply is received, the "try again now" tells the IDL client not to wait for another database change before retrying its transaction. Bug #5980. Reported-by: Ram Jothikumar <rjothikumar@nicira.com> Reproduced-by: Alex Yip <alex@nicira.com>
2011-10-12ovs.db.types: Consistently use commas in formatting large numbers.Ben Pfaff
Suggested-by: Justin Pettit <jpettit@nicira.com>
2011-09-29ovs.daemon: Fix bug introduced by "pychecker" warning fixes.Ben Pfaff
Commit 591c20651f1 "daemon.py: Don't shadow built-in 'file' variable" changed most instances of "file" to "file_handle" but missed this one. I'm not certain that this solves a real problem, but it still seems wrong. Bug #7533.
2011-09-29ovs.daemon: Fix semantics of --pidfile option.Ben Pfaff
The --pidfile option is supposed to work like this: * Without --pidfile, you don't get a pidfile. * With --pidfile, you get the default pidfile. * With --pidfile=FILE, you get FILE as your pidfile. However, it actually worked like this: * Without --pidfile, you got the default pidfile. * With --pidfile, you got no pidfile at all. * With --pidfile=FILE, you got FILE as your pidfile. This is because of the semantics of "default" in argparse. It is documented as: The default keyword argument of add_argument(), whose value defaults to None, specifies what value should be used if the command-line argument is not present. For optional arguments, the default value is used when the option string was not present at the command line. We actually want "const", which is documented under the description of nargs="?" as: If no command-line argument is present, the value from default will be produced. Note that for optional arguments, there is an additional case - the option string is present but not followed by a command-line argument. In this case the value from const will be produced. Bug #7533.
2011-09-27python: Upgrade to vlog.Ethan Jackson
This patch upgrades the library code in the python/ovs directory to the new vlog module.
2011-09-27python: Upgrade daemon module to argparse.Ethan Jackson
This patch also updates it's callers.
2011-09-27stream.py: Make usage() function return a string.Ethan Jackson
This will marginally simplify a future patch.
2011-09-27python: Create new vlog module.Ethan Jackson
Currently, each python daemon has to come up with it's own logging solution. These logging strategies are not consistent across the python code or with the C vlog module. This patch adds a new logging module which hopes to solve the problem. This new module generates log messages in a manner consistent with the C code. Furthermore, it can easily be extended to support things like rate limiters in the future. This patch does not update any python code to use the new module.
2011-09-26json.py: Typo in parsing code.Ben Pfaff
2011-09-24python: Style cleanup.Ethan Jackson
This patch does minor style cleanups to the code in the python and tests directory. There's other code floating around that could use similar treatment, but updating it is not convenient at the moment.
2011-09-24ovsuuid.py: Fix use of undefined symbol.Ethan Jackson
Found by pychecker.
2011-09-23python: Implement write support in Python IDL for OVSDB.Ben Pfaff
Until now, the Python bindings for OVSDB have not supported writing to the database. Instead, writes had to be done with "ovs-vsctl" subprocesses. This commit adds write support and brings the Python bindings in line with the C bindings. This commit deletes the Python-specific IDL tests in favor of using the same tests as the C version of the IDL, which now pass with both implementations. This commit updates the two users of the Python IDL to use the new write support. I tested this updates only by writing unit tests for them, which appear in upcoming commits.
2011-09-23ovs.db.types: Add table reference to ovs.db.types.BaseType.Ben Pfaff
Until now ovs.db.types.BaseType has kept track of the name of the referenced table but not a reference to it. This commit renames the ref_table attribute to ref_table_name and adds a new ref_table attribute whose value is a reference to the named table. This will be useful in an upcoming commit where table references are actually followed.
2011-09-23python: Accept multiple forms of strings and lists when parsing JSON.Ben Pfaff
The JSON parser in OVS always yields unicode strings and lists, never non-unicode strings or tuples, but it's easy to create them when building JSON elsewhere, so accept both forms.
2011-09-23python: Change 'clone' function names to 'copy'.Ben Pfaff
It seems that 'copy' is the proper name for this kind of function in Python, based on the existence of dict.copy().
2011-09-23ovs.ovsuuid: Get rid of ovs.ovsuuid.UUID class.Ben Pfaff
This class only caused unnecessary confusion. This commit changes all of its methods into top-level functions.
2011-09-23ovs.jsonrpc: Include result in Message.__str__() output.Ben Pfaff
This was overlooked in the initial implementation. Including the result member makes logging output more useful.
2011-09-23ovs.db.data: Make Datum.check_constraints() work.Ben Pfaff
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-23ovs.db.data: Fix Atom.new()'s handling of Boolean values.Ben Pfaff
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-23ovs.json: Remove commented-out debug code.Ben Pfaff
This must have slipped into an old commit by accident.
2011-09-23ovs.json: Actually implement the "pretty" option for serialization.Ben Pfaff
2011-09-23python: Avoid shadowing standard or global names.Ben Pfaff
Found by pychecker.
2011-09-23python: Avoid "unused parameter" warnings from pychecker.Ben Pfaff
pychecker ignores parameters named "_" or prefixed with "unused_".
2011-09-23ovs.db.types: Always initialize ref_type attribute.Ben Pfaff
The ref_type attribute was initialized on some paths but not others. Found by pychecker.
2011-09-16daemon.py: Silence return warning.Ethan Jackson
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-16daemon.py: Don't shadow built-in 'file' variable.Ethan Jackson
Pychecker considers it bad style.
2011-09-16daemon.py: Whitespace cleanup.Ethan Jackson
The python style guide requires two newlines between top level definitions. This patch also removes some trailing whitespace.
2011-09-15Mark "uninstall-local" targets phony.Ben Pfaff
2011-08-25ovs.db.types: Remove write-only variable from constraintsToEnglish().Ben Pfaff
Found by pychecker.
2011-08-25python: Remove unused imports.Ben Pfaff
Found by pychecker.
2011-08-25ovs.stream: Remove unused parameter from usage().Ben Pfaff
This function has no callers. We could delete it entirely, instead.
2011-08-25ovs.ovsuuid: Fix UUID.cInitUUID invocation of re.match with too few params.Ben Pfaff
Found by pychecker.
2011-08-25ovs.jsonrpc: Fix static method Session.open() reference to 'self'.Ben Pfaff
Found by pychecker.
2011-08-25ovs.jsonrpc: Fix static method Message.__validate_arg reference to 'self'.Ben Pfaff
This method needs to be an instance method because it refers to 'self'. Found by pychecker.
2011-08-25ovs.json: Use Exception, which exists, instead of Error, which doesn't.Ben Pfaff
Found by pychecker.
2011-08-25ovs.db.idl: Fix error message format arguments.Ben Pfaff
There's no variable table_name. Found by pychecker.
2011-08-25ovs.daemon: Add missing format string argument.Ben Pfaff
Found by pychecker.
2011-08-25ovs.daemon: Fix name of EALREADY error.Ben Pfaff
Found by pychecker.
2011-08-25ovs.daemon: Add missing 'global' when setting _pidfile_dev, _pidfile_ino.Ben Pfaff
Found by pychecker.
2011-08-25ovs.db.idl: Fix call to ovs.db.parser.Parser constructor.Ben Pfaff
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-24python: Use enumerate() builtin function to simplify counted iteration.Ben Pfaff
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24ovs.stream: Simplify logic in Stream.wait().Ben Pfaff
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24ovs.stream: Drop Stream.get_name() since clients can use 'name' directly.Ben Pfaff
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24ovs.stream: Use %d in place of %ld since the two are equivalent in Python.Ben Pfaff
Reported-by: Reid Price <reid@nicira.com>
2011-08-24ovs.reconnect: Fix typo in documentation.Ben Pfaff
Reported-by: Reid Price <reid@nicira.com>