Every time I run a large chunk of neutron unit tests, for
example:
$ tox -e py310 -- neutron.tests.unit.plugins.ml2.drivers
I see this warning (it doesn't cause a failure):
Captured stderr:
~~~~~~~~~~~~~~~~
.../neutron/.tox/py310/lib/python3.10/site-packages/ovs/db/idl.py:1484:
DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
vlog.warn("error parsing column %s in table %s: %s"
Looking at the OVS python library code it seems perfectly fine.
Backtracking, I was able to find the offending code that
actually lived in ovsdbapp. It is a little bit obfuscated
as it was re-mapping the OVS library vlog.Vlog.warn() call
to log.warn(), but I was able to test my theory by modifying
code in my local neutron .tox directory and the warning
went away.
I was never able to narrow things down to a single test, or
class, or file, even running with '--concurrency 1', so I
do not know exactly how this code is getting exercised,
there could be a test that is not cleaning-up properly,
maybe some day we will figure that out.
TrivialFix but not TrivialToFind
Change-Id: Ic6256b4bab48298fe599b7904e9edb0e35b93ce4
Required for handling the cases where set_options
is called on non-existing logical router port.
The option is added to parent class BaseSetOptionsCommand, so
if other apis relying on that need to expose if_exists then those
can be extended in future.
Partial-Bug: #2065701
Related-Bug: #2060163
Change-Id: I56685478214aae7b6d3a2a3187297ad4eb1869a3
Before the patch, the code was always attempting to rebuild indices and
start a connection, even if a connection was already started and cached
in .ovsdb_connection class attribute.
(Both operations were gracefully handled as no-ops. But they left some
confusing log messages about indices rebuild etc.)
Change-Id: Ib9ef29da251f5d184fa6abd20e1b17010f2ed1a1
netaddr 0.10 added flags to define the semantics while parsing
IP addresses. available are inet_pton() and inet_aton() semantics,
which inet_aton() semantics the default in 0.10 and inet_pton() the
default in 1.x. As the testsuite specifically tests for aton semantics,
set that flag.
Change-Id: I06eec5619f958f6c4b90f6068c361a18c2356be6
The ovn-nb manpage states that for v6 addresses, the IPs need to
be enclosed in brackets for Load_Balancer.ip_port_mappings.
Closes-Bug: #2057471
Signed-off-by: Terry Wilson <twilson@redhat.com>
Change-Id: If93037f35723c56d3da635e1a7aa42c092c8e7d6
The status column is updated by OVN so we cannot rely on its
contents being stable.
The test already attempts to address this by using frozen rows,
but that does not fully solve the issue as objects are created at
different points in time and then compared, which may give
unpredictable results.
Filter out the `status` column from the affected tests.
Closes-Bug: #2058264
Change-Id: Ibaa54d93109434b445f54de583f534021defccbb
Signed-off-by: Frode Nordahl <fnordahl@ubuntu.com>
When deleting a chassis from OVN Southbound it should be also deleted from Chassis_Private table
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
Change-Id: Ibff5fb6c4a809e798b5cf0e70f0861264043c7ba
Pass an instance of idlutils.Row mirror as a value instead of raw string/uuid
to addvalue/delvalue methods since OVS library Atom.from_python() ctor
doesn't expect string as an argument.
Closes-bug: #2055094
Change-Id: Ibc1a5aaefe68f7e02f92285900654c9f70aed69e
Currently the index logical_port on Port_Binding
is missing because autocreate_indices() skips
indexes with multiple columns:
-> "indexes": [["datapath", "tunnel_key"], ["logical_port"]]
This slows down the ovn-bgp-agent at scale(31060 Port_Binding
entries) heavily. (See bug #https://bugs.launchpad.net/ovn-bgp-agent/+bug/2045892)
Full sync iteration:
Without Port_Binding index: ~6min
With Port_Binding index: ~5sec
Closes-Bug: #2045892
Change-Id: I815c695fd8a5e12a94e02a7a29da8aadc99541c4
Allow to install static route even if static route with same CIDR has
been learned by ovn-ic from another AZ.
See this commit for more information: 68105f68c3
Closes-bug: 2037573
Change-Id: I2a7a110551ee302dc9602ef6b01153262ea637d4
Adds possibility to specify 'route_table' in methods for static
routes.
See this commit for more information:
1655a6c146
Closes-bug: 2037652
Change-Id: Ic965ae098adb6db2e5a057eee74250e3b6331b01
In request https://review.opendev.org/c/openstack/ovsdbapp/+/882268, the ability to create ECMP routes was added. This PR adds the ability to delete these routes.
Closes-bug: 2037536
Change-Id: I84f234c6c5bbf4d318893166943de62fb87fff69
The original goal of adding match_fn() the ovs_idl backend
implementation of RowEvent was to give an option to specify more
complex matching behavior than conditions/old_conditions allowed.
It was never intended that users would use both together, but it
also was not documented that that was the case. This patch allows
conditions and match_fn() to be treated as a logical AND to avoid
accidentally removing conditions when adding a match_fn()
Change-Id: Ifc18bf42e2a0ce8247bf986d14646f66d9554ca7
If OVN and OVS are not installed on the system, but cloned into '.venv',
the 'OvsVtepVenvFixture' class is not instantiated correctly and all
unit tests fail.
Closes-bug: 2037568
Change-Id: Id26004b57cb02900faed5dabeee8956ff9c66b54
This patch sets the default for peers to [] instead of None, to match
what it is stored on the DB
Closes-Bug: #2019109
Change-Id: I66948039e61503480fd140ee9e0ce645a6ef4453
The original API for db_set() out of an over-abundance of caution
use *args tuples in the format of ('column_name', value) due to the
fear that there may be OVSDB column names that were not valid
Python argument names (e.g. 'some-column'). But the OVSDB RFC
forbids column names that would be a problem.
This patch adds **columns which will be used only if there are
no values passed as *col_values. It also adds if_exists support
to db_set(), as there are situations where you don't want to throw
an error if you are updating a Row in a multi-op transaction and
it's possible that the row has been deleted on the server.
Change-Id: Ia17e545706a16f5c726ec52bae339e9362b0b614
Neutron currently overrides wait_for_change because it needs a
version without a timeout. This adds the ability to set either
timeout=None or timeout <= 0 to not timeout.
Change-Id: Iff708c259a5500848eab73b05da70300ff8e4134
Now it is possible to define the "Interface" parameters when creating
a "Port" register (a "Interface" register is created along with any
new "Port").
Related-Bug: #2006603
Change-Id: I6b946ef27b38e76fd70d2b529d645f5f09ac2404
This is used to detect if a given logical_switch has localnet
ports associated to it, and return them
Change-Id: Iabfc1bd0a1b2c6998a013d19c47cda10a3879c82
Now "HAChassisGroupAddChassisCommand" and
"HAChassisGroupDelChassisCommand" accept "HAChassisGroupAddCommand"
as input parameter.
That allows to add and remove "HA_Chassis" from the "HA_Chassis_Group"
register in the same transaction that has created the HA Chassis
Group.
Related-Bug: #1995078
Change-Id: I443796cc2fcd7eef46f968a8383d068bab6ae670
The setDaemon method of the threading.Thread was deprecated
in Python 3.10 (*).
Replace the setDaemon method with the daemon property.
*: https://docs.python.org/3.10/library/threading.html#threading.Thread.setDaemon
Change-Id: Id4b6df45ba4741e410692df7bd11db3f56f00f45
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
There's no reason to believe that reconnecting to ovsdb-server will
resolve an unhandled exception in python-ovs. In addition, since users
often subclass Idl and add their own notify() methods, there could be
exceptions thrown from that code.
The best we can do is log what is going on and rely on users to fix
the issue. Delaying with sleep() is usually a bad idea since if there
was some kind of ovsdb reconnection, it will delay calls to Idl.run()
which will handle that reconnection over several calls.
Change-Id: Iab2177fb9fa653292a3805689895f98e0833dc4a
Transaction errors trigger logging exceptions due to the extra
comma that makes the second half of a message be treated as an
argument.
Change-Id: I83ef19f7fed673907a35f54dd123deb7996cce57
I believe removing wait_for_change back in the day was an error.
We can't do the exponential backoff ourselves because that will
also delay reconnecting to the the db, because idl.run() needs to
be called. Also, do_commit() doesn't ensure that idl.run() is
called if status is TRY_AGAIN. wait_for_change() will ensure that
we call idl.run() to reconnect quickly and don't try the txn again
until we have reconnected and the seqno has changed.
Revert "Don't spam retries 100s of times a second"
This reverts commit 6596164f51.
Revert "Ensure idl.run() called on TRY_AGAIN"
This reverts commit 1810faecc9.
Revert "Don't wait on TRY_AGAIN when calling commit_block()"
This reverts commit 158ae06bce.
Closes-Bug: #1988457
Change-Id: I237136262862d5117d08eb3b513a0b8658a79f05
This change adds functions and commands to add, delete, list, get and
update health checks of load balancers. Also added a method to get one
load balancer by name or uuid and methods to modify 'ip_port_mappings'
column in the load balancer.
Closes-Bug: 1964382
Change-Id: I3f8b63c64c7ac9c570dbd400c562fa97840429ca