2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 05:18:13 +00:00

271 Commits

Author SHA1 Message Date
Ben Pfaff
18e124a20b daemon: Avoid redundant code in already_running().
This function substantially duplicated read_pidfile(), so reuse that
code instead.
2011-03-29 10:09:47 -07:00
Ben Pfaff
2159de8391 daemon: Write "already running" message to log also.
Otherwise it's hard to diagnose later if the daemon failed to start because
it thinks that it is already running.
2011-03-29 10:09:23 -07:00
Andrew Evans
34d84bb951 reconnect.py: Fix Python 2.4 compatibility break.
Commit 5eda645e36 (ovsdb-server: Report time since last connect and disconnect
for each manager.) used a conditional expression in reconnect.py. That syntax
is only supported in Python 2.5 and later. XenServer 5.6 is based on RHEL 5,
which uses Python 2.4.3, so various OVS scripts on XenServer fail with Python
tracebacks.

Reported-by: Cedric Hobbs <cedric@nicira.com>
2011-03-15 14:42:49 -07:00
Andrew Evans
5eda645e36 ovsdb-server: Report time since last connect and disconnect for each manager.
Only the time connected (if connected) or disconnected (if disconnected) is
currently reported for each manager. Change to reporting both in seconds since
the last connect and disconnect events respectively. An empty value indicates
no previous connection or disconnection.

This can help diagnose certain connectivity problems, e.g. flapping.

Requested-by: Peter Balland <peter@nicira.com>
Bug #4833.
2011-03-14 13:10:02 -07:00
Ben Pfaff
c5f341ab19 ovsdb: Implement garbage collection. 2011-03-10 11:24:00 -08:00
Ben Pfaff
acb4f876b8 ovsdb-idlc: Initialize refType in IDL reference columns' types.
Otherwise the refType always appears to be 0 (OVSDB_REF_STRONG).

Nothing in the code that uses these structures actually uses the refType
yet, so this does not fix any existing bug, but upcoming commits will add
users.
2011-03-10 11:23:58 -08:00
Ben Pfaff
fdba672899 python/ovs/ovsuuid: Fix behavior of UUID.from_json() with no symbol table.
UUID.from_json(['named-uuid', 'x'], None) should raise an error about
invalid syntax, but instead it was raising a TypeError because it would
try to evaluate "'x' not in None".  This fixes the problem and adds a test.
2011-03-10 11:23:58 -08:00
Andrew Evans
c36cf65eda reconnect: Rename CONNECT_IN_PROGRESS state to CONNECTING (like rconn).
reconnect uses the same connection state names as rconn with the exception of
the above. This commit makes their states identical, which should reduce
confusion for people debugging connection problems.
2011-03-10 11:12:20 -08:00
Andrew Evans
eba18f0044 reconnect: Track last-disconnected time.
Commit a4613b01ab (ovsdb: Change the way connection duration time is reported
in Manager table.), pushed earlier today, requires this commit, so OVSDB has
been unbuildable from then to now.
2011-03-09 18:40:03 -08:00
Justin Pettit
da51646f6f jsonrpc.py: Import "ovs.json".
Reported-by: Giuseppe de Candia <giuseppe.decandia@gmail.com>
2011-02-21 23:56:07 -08:00
Ben Pfaff
a44d74d752 python: Use os.path.basename instead of open-coding it.
Reported-by: Justin Pettit <jpettit@nicira.com>
2011-01-12 13:51:42 -08:00
Ethan Jackson
5601839c45 python: properly initialize string length on 64bit systems.
types.py was initializing max string length to 2^64 - 1 instead of
UINT_MAX on 64 bit systems.  This commit fixes that problem.
2011-01-04 10:30:37 -08:00
Ben Pfaff
8159b984dc Implement database schema versioning.
As the database schema evolves, it might be useful to have an identifier
for the particular version in use.  This commit adds that feature.
2010-12-27 14:26:47 -08:00
Ben Pfaff
b43c6fe279 Make installation directories overridable at runtime.
This makes it possible to run tests that need access to installation
directories, such as the rundir, without having access to the actual
installation directories (/var/run is generally not world-writable), by
setting environment variables.  This is not a good way to do things in
general--usually it would be better to choose the correct directories
at configure time--so for now this is undocumented.
2010-11-29 16:29:11 -08:00
Ben Pfaff
0f9fc40325 ovsdb: Fix formatting of ovs.db.Error on Python 2.6.
All of the negative Python OVSDB tests were failing on Python 2.6 because
"%s\n" % e yielded the empty string on that version of Python.  In turn,
that was because ovs.db.error.Error.__unicode__ was being called instead of
ovs.db.error.Error.__str__.  I'm puzzled why that was happening, but this
commit fixes it and also seems like a small code cleanup.

Peter Balland helped me gain some insight on this problem.

CC: Peter Balland <peter@nicira.com>
CC: Reid Price <reid@nicira.com>
2010-11-02 13:28:47 -07:00
Ethan Jackson
998bb652ec xenserver: monitor-external-ids should run with --monitor
The init script starts monitor-external-ids with --monitor when
configured to do so.  Also made changes to guarantee that --monitor
actually restarts ovs-external-ids.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2010-09-22 20:06:40 -07:00
Ben Pfaff
e4bd5e2a6c daemon: Fix behavior of read_pidfile() for our own pidfile.
Opening a file descriptor and then closing it always discards any locks
held on the underlying file, even if the file is still open as another file
descriptor.  This meant that calling read_pidfile() on the process's own
pidfile would discard the lock and make other OVS processes think that the
process had died.  This commit fixes the problem.
2010-09-23 11:45:34 -07:00
Ethan Jackson
110b54816b python: timer_wait_until calculated current time incorrectly
The timer_wait_until function in poller.py was using Time.msec to
figure out the current time.  Unfortunately, Time.msec does not in
exist. Changed to use ovs.timeval.msec .
2010-09-17 18:05:06 -07:00
Ben Pfaff
5c16362b51 ovsdb-doc: Be less explicit in ovs-vswitchd.conf.db(5).
The documentation doesn't really need to say that a field may be "between
0 and 4294967295 characters long".

This regression was introduced by commit 991559357 "Implement initial
Python bindings for Open vSwitch database."
2010-09-17 10:17:27 -07:00
Ben Pfaff
3161c659b7 xenserver: Add type-checking to monitor-external-ids script.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-08-26 10:29:43 -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