neutron/neutron/cmd
Armando Migliaccio 17563a802e Adopt neutron-lib plugin directory
Neutron Manager is loaded at the very startup of the neutron
server process and with it plugins are loaded and stored for
lookup purposes as their references are widely used across the
entire neutron codebase.

Rather than holding these references directly in NeutronManager
this patch refactors the code so that these references are held
by a plugin directory.

This allows subprojects and other parts of the Neutron codebase
to use the directory in lieu of the manager. The result is a
leaner, cleaner, and more decoupled code.

Usage pattern [1,2] can be translated to [3,4] respectively.

[1] manager.NeutronManager.get_service_plugins()[FOO]
[2] manager.NeutronManager.get_plugin()
[3] directory.get_plugin(FOO)
[4] directory.get_plugin()

The more entangled part is in the neutron unit tests, where the
use of the manager can be simplified as mocking is typically
replaced by a call to the directory add_plugin() method. This is
safe as each test case gets its own copy of the plugin directory.
That said, unit tests that look more like API tests and that rely on
the entire plugin machinery, need some tweaking to avoid stumbling
into plugin loading failures.

Due to the massive use of the manager, deprecation warnings are
considered impractical as they cause logs to bloat out of proportion.

Follow-up patches that show how to adopt the directory in neutron
subprojects are tagged with topic:plugin-directory.

NeutronLibImpact

Partially-implements: blueprint neutron-lib

Change-Id: I7331e914234c5f0b7abe836604fdd7e4067551cf
2016-11-23 04:45:33 -07:00
..
eventlet Adopt neutron-lib plugin directory 2016-11-23 04:45:33 -07:00
sanity sanity check: Check that ip_nonlocal_bind works with namespaces 2016-11-18 08:36:51 -05:00
__init__.py Fix logging error for Guru Meditation Report 2016-02-08 16:52:17 -08:00
ipset_cleanup.py Refactoring config options for cmd 2016-07-31 04:37:29 +00:00
keepalived_state_change.py Replace keepalived notifier bash script with Python ip monitor 2015-03-18 18:59:33 -04:00
linuxbridge_cleanup.py neutron-lib: start using neutron-lib helpers 2016-10-10 01:30:26 -07:00
netns_cleanup.py Refactoring config options for cmd 2016-07-31 04:37:29 +00:00
ovs_cleanup.py Refactoring config options for cmd 2016-07-31 04:37:29 +00:00
pd_notify.py neutron-lib: use replace_file from neutron lib 2016-11-07 09:18:41 +00:00
sanity_check.py sanity check: Check that ip_nonlocal_bind works with namespaces 2016-11-18 08:36:51 -05:00