2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-24 02:47:14 +00:00

11 Commits

Author SHA1 Message Date
Alin Balutoiu
9e03d7344c Python tests: Daemon ported to Windows
Instead of using os.fork (not supported on Windows),
subprocess.Popen is used and os.pipe was replaced
with Windows pipes.

To be able to identify the child process, an extra
parameter was added to daemon process '--pipe-handle'.
This parameter contains the parent Windows pipe handle
which is used by the child to notify the parent about
the startup.

The PID file is created directly on Windows, without
using a temporary file because the symbolic link does
not inherit the file lok set on the temporary file.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Signed-off-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2017-01-03 12:49:50 -08:00
Russell Bryant
5697ca9901 python: Remove unused imports and variables.
This resolves the following flake8 error types:

  F841 local variable 'e' is assigned to but never used
  F401 'exceptions' imported but unused

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2016-01-05 18:13:47 -05:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Ethan Jackson
3a656eafb9 python: Upgrade to vlog.
This patch upgrades the library code in the python/ovs directory to
the new vlog module.
2011-09-27 14:51:49 -07:00
Ethan Jackson
b153e66790 python: Upgrade daemon module to argparse.
This patch also updates it's callers.
2011-09-27 14:51:49 -07:00
Ethan Jackson
50e97486ca tests: Cleanup test-daemon.py style.
By convention, unused arguments should be named "_" and top level
definitions should be separated by two spaces.
2011-09-16 15:51:12 -07:00
Ben Pfaff
aacea8ba43 daemon: Avoid races on pidfile creation.
Until now, if two copies of one OVS daemon started up at the same time,
then due to races in pidfile creation it was possible for both of them to
start successfully, instead of just one.  This was made worse when a
previous copy of the daemon had died abruptly, leaving a stale pidfile.

This commit implements a new pidfile creation and removal protocol that I
believe closes these races.  Now, a pidfile is asserted with "link" instead
of "rename", which prevents the race on creation, and a stale pidfile may
only be deleted by a process after it has taken a lock on it.

This may solve mysterious problems seen occasionally on vswitch restart.
I'm still puzzled by these problems, however, because I don't see anything
in our tests cases that would actually cause two copies of a daemon to
start at the same time, which as far as I can see is a necessary
precondition for the problem.
2011-04-04 10:59:19 -07:00
Ben Pfaff
00c0858987 daemon: Integrate checking for an existing pidfile into daemonize_start().
Until now, it has been the responsibility of an individual daemon to call
die_if_already_running() at an appropriate time.  A long time ago, this
had to happen *before* daemonizing, because once the process daemonized
itself there was no way to report failure to the process that originally
started the daemon.  With the introduction of daemonize_start(), this is
now possible, but we haven't been taking advantage of it.

Therefore, this commit integrates the die_if_already_running() call into
daemonize_start() and deletes the calls to it from individual daemons.
2011-04-04 10:58:55 -07:00
Ethan Jackson
6793129d36 tests: Test that children restart with special exit code
Added a test which checks that the python daemon code properly
restarts child processes which exit with RESTART_EXIT_CODE.
2010-09-23 02:00:03 -07:00
Ethan Jackson
9c64f2384d tests: Remove trailing whitespace from python daemon tests
Removes the trailing whitespace from the testing code related to
daemonizing in Python.
2010-09-22 23:09:41 -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