idl_factory was removed in favor of just passing in an Idl instance
as an Idl doesn't start a connection until its .run() is called.
The try/excepts will be removed when the ovsdbapp 0.4.0 constraint
changes are merged.
This patch uses the ovsdbapp Python library, which is the new
project based on the Neutron OVSDB API.
The CLI implementation of the OVSDB API remains in the Neutron
Neutron continues providing the (deprecated) ability to allow
the OVSDB API to be imported from Neutron.
The deleted tests exist in the ovsdbapp project. More will be
moved later, but many of the tests in the Neutron tree use
ovs_lib, which doesn't exist in ovsdbapp so those tests will
probably stay in the Neutron tree.
This change, in a backward-compatible way, allows users of the
native OVSDB library to pass in their own Idl factory function
where they can return any subclass of the Idl, any schema, and
and register whatever tables/columns they want. This way, we
do not have to keep up with changes to the upstream OVSDB Idl
The Connection connection, schema_name, and idl_class arguments
are deprecated in favor of the idl_factory function.
We are replacing all usages of the 'retrying' package with
'tenacity' as the author of retrying is not actively maintaining
the project. Tenacity is a fork of retrying, but has improved the
interface and extensibility (see  for more details). Our end
goal here is removing the retrying package from our requirements.
Tenacity provides the same functionality as retrying, but has the
following major differences to account for:
- Tenacity uses seconds rather than ms as retrying did.
- Tenacity has different kwargs for the decorator and
Retrying class itself.
- Tenacity has a different approach for retrying args by
using classes for its stop/wait/retry kwargs.
- By default tenacity raises a RetryError if a retried callable
times out; retrying raises the last exception from the callable.
Tenacity provides backwards compatibility here by offering
the 'reraise' kwarg.
- Tenacity defines 'time.sleep' as a default value for a kwarg.
That said consumers who need to mock patch time.sleep
need to account for this via mocking of time.sleep before
tenacity is imported.
- For retries that check a result, tenacity will raise if the retried
function raises, whereas retrying retried on all exceptions.
This patch updates all usages of retrying with tenacity.
Unit tests will be included where applicable.
Note: This change is not newton critical so projects are welcome
to hold off on committing until post-newton. Ideally this change
will merge by the first part of Ocata so dependant functionality
can land and have time to solidify for Ocata.
Move the generation of the schema helper in OVSDB connection to a
In the OVSDB connection class, move the code retrieving the schema
helper to a separate method. This will allow subclasses to override this
method, and retrieve the schema helper in a different manner, or provide
it to the Connection subclass in advance.
This use-case came up in Dragonflow, where we wanted to retrieve
specific columns within specific tables, and not the whole tables.
Add an option to neutron.agent.ovsdb.native.connection.Connection to
override the Idl class that is created to communicate with OVSDB.
This is a feature that would help in Dragonflow, where the notify
method should be overriden before start() is called, in order to receive
all events in real-time, and not retroactively.
 d17ae9705a/dragonflow/ovsdb/impl_idl.py (L135)
calls Connection.start() which starts a daemon with a while True loop
full of mocks. mock._CallList of those mocks start to grow very
quick and finally eat all available memory.
Post-2.5 ovs Python library now supports Python 3  and we require
2.6dev version for py34 job, so we're fine to run ovsdb tests with
With native ovsdb_interface several py34 tests fail
with ValueError during ovs_lib.OVSBridge creation
because of unbuffered text I/O in TransactionQueue
This patch fixes the issue by switching to binary mode
The second thread running in ovsdb connection crashed due to not passing
file descriptor to poller. This patch mocks out the poller as it's not
used in the tests to avoid false tracebacks in the logs.
Current OVSDB Connection will register all tables with schema_helper.
It doesn't matter for most cases, but for implementation for bp
routed-networks in networking-ovn, we don't need all tables in OVN_
Southbound DB are registered. We only need a certain table named
Chassis can be registered.
This patch add a parameter for OVSDB Connection to allow it to
register certain tables, instead of all tables.