2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-23 02:17:42 +00:00

13 Commits

Author SHA1 Message Date
Ihar Hrachyshka
fdbf0bb2ae flake8: Fix E721 check failures.
E721: "do not compare types, for exact checks use `is` / `is not`, for
instance checks use `isinstance()`"

This fixes `make flake8-check` target when running with
pycodestyle>=1.2.

Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2023-11-01 10:54:19 +01:00
Rosemarie O'Riorden
bd90524550 Remove Python 2 leftovers.
Fixes: 1ca0323e7c29 ("Require Python 3 and remove support for Python 2.")
Reported at: https://bugzilla.redhat.com/show_bug.cgi?id=1949875
Signed-off-by: Rosemarie O'Riorden <roriorde@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-06-22 21:29:57 +02:00
Alin Balutoiu
03947eb7ec Python tests: Ported UNIX sockets to Windows
Unix sockets (AF_UNIX) are not supported on Windows.
The replacement of Unix sockets on Windows is implemented
using named pipes, we are trying to mimic the behaviour
of unix sockets.

Instead of using Unix sockets to communicate
between components Named Pipes are used. This
makes the python sockets compatible with the
Named Pipe used in Windows applications.

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:48:58 -08:00
Russell Bryant
8ea171aba0 python: Fix print function compatibility.
The print statement from Python 2 is a function in Python 3.  Enable
print function support for Python 2 and convert print statements to
function calls.

Enable the H233 flake8 warning.  If the hacking plugin is installed,
this will generate warnings for print statement usage not compatible
with Python 3.

  H233 Python 3.x incompatible use of print operator

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2016-01-12 11:47:33 -05:00
Russell Bryant
603e325fa5 python: Resolve a deprecation warning.
Resolve the following deprecation warning.  This deprecation warning
advises to use an alternative syntax which is also compatible with
Python 3, where has_key() was removed.

  W601 .has_key() is deprecated, use 'in'

Also fix this related error:

  E713 test for membership should be 'not in'

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2016-01-05 18:16:49 -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
b153e66790 python: Upgrade daemon module to argparse.
This patch also updates it's callers.
2011-09-27 14:51:49 -07:00
Ethan Jackson
ec394dad53 stream.py: Make usage() function return a string.
This will marginally simplify a future patch.
2011-09-27 14:50:26 -07:00
Ethan Jackson
484185ec4e test-jsonrpc: Help option doesn't work.
The test-jsonrpc.py script didn't understand the "-h" option and
threw an exception when "--help" was supplied.
2011-09-26 16:12:33 -07:00
Ethan Jackson
e60a5e2637 tests: test-jsonrpc.py whitespace cleanup.
Pleases pep8.
2011-09-23 15:26:42 -07:00
Ethan Jackson
d2dc8f5806 tests: test-jsonrpc references nonexistent variable. 2011-09-23 15:26:08 -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
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