Commit Graph

29 Commits

Author SHA1 Message Date
Boden R
a039966ba2 Rehome ServicePluginBase
A number of subprojects inherit neutron's ServicePluginBase
class [1]. This patch rehomes ServicePluginBase into
neutron-lib along with 2 other classes required for the
implementation of ServicePluginBase.

UTs and a release note are also included.

[1] http://codesearch.openstack.org/?q=ServicePluginBase

Change-Id: I2b1131ac53e9bfeb42a92f9ef134be6ff4cfe5a3
2017-01-13 11:58:09 -07:00
Jenkins
de12c6753b Merge "Make neutron context available in neutron-lib" 2017-01-12 19:38:17 +00:00
Jenkins
8b3a74c8b9 Merge "Expose/Improve callback notification interface" 2017-01-12 19:02:07 +00:00
Armando Migliaccio
6d5e550446 Make neutron context available in neutron-lib
Even though the context was marked private, we should
consider it public as it is widely used across the
board, and it has demonstrated itself to be one of
the most stable components ever conceived in the
Neutron maze.

NeutronLibImpact

Partially-implements: blueprint neutron-lib

Change-Id: Ibb3797c17fef5a1ead40aa2cad1269ce11c45339
2017-01-11 18:25:20 -08:00
Jenkins
7eb5190cec Merge "Add validators/converters needed by neutron-fwaas" 2017-01-12 00:52:29 +00:00
Jenkins
03b789da15 Merge "Removes unnecessary utf-8 encoding" 2017-01-11 21:25:35 +00:00
Boden R
fea8bb64ba Expose/Improve callback notification interface
This patch builds a small hierarchy of event objects that
represent the payload for callback notification events. The
overall goal of this work is to begin moving away from the
existing unstructured  **kwargs passed today and standardize
on a common set of event payload objects; the beginning of such
contained herein.

A PoC/dummy patch for neutron is provided in [1] that exemplifies
consumption of the new API by:
- Removes neutron.callbacks and moves all uses to
neutron_lib.callbacks.
- Neutron uses of callbacks for BEFORE_RESPONSE events
now use neutron-lib.
- Neutron uses of callbacks for ROUTER and PROCESS
resource events now use neutron-lib.
- Neutron UTs updated to pass with this patch.

For existing discussion on this approach please see [2][3].

Co-Authored-By: Armando Migliaccio <armamig@gmail.com>

[1] https://review.openstack.org/400404/
[2] https://review.openstack.org/#/c/345718
[3] https://review.openstack.org/#/c/342304

Change-Id: If76457b1f0d5d3479e394d0dba3b22a90928f0f2
2017-01-11 13:47:12 -07:00
Nate Johnston
100bc4e294 Add validators/converters needed by neutron-fwaas
This change adds additional validators and converters needed by the
neutron-fwaas API definition[1].

[1] https://review.openstack.org/389388

Co-Authored-By: ZhaoBo <zhaobo6@huawei.com>

Change-Id: If49391647dfa0cb1eeca4c80abdc7397eb639675
2017-01-11 19:12:51 +00:00
Armando Migliaccio
1c92b539ff Add fixture for plugin directory
This is needed to stop stubbing out _get_plugin_directory
from neutron unit tests, thus preserving testing isolation.

Change-Id: Ic94b264068955c67d71b86fe54825b9fba4533ac
2017-01-09 15:48:53 -08:00
Cao Xuan Hoang
6a9e6d98e5 Removes unnecessary utf-8 encoding
The following file(s) added utf-8 encoding but never used. So we can
remove them at all.

neutron_lib/__init__.py
neutron_lib/tests/unit/callbacks/test_callback_exceptions.py
neutron_lib/tests/unit/test_exceptions.py
neutron_lib/tests/unit/test_neutron_lib.py
releasenotes/source/conf.py
doc/source/conf.py
api-ref/source/conf.py

Change-Id: I45f1d48f8df461b67e6c37a37e0577ed4c1296a1
2016-12-28 17:08:10 +07:00
Jenkins
b5faa921ee Merge "Add validator to check for IP or subnet or none" 2016-12-23 15:33:19 +00:00
Jenkins
d8a75430c0 Merge "Use new checks in hacking 0.12" 2016-12-19 17:21:04 +00:00
Jenkins
a93a5c9761 Merge "Migrate neutron agent extensions to neutron-lib" 2016-12-16 15:42:55 +00:00
Boden R
b6244f5b37 Migrate neutron agent extensions to neutron-lib
Migrate neutron agent extensions to neutron-lib.  This includes both the
common abstract object as well as the l2 and l3-specific objects for
agent extensions.

This functionality is used by neutron, neutron-fwaas, networking-sfc,
and tap-as-a-service.

Please note that this does not migrate the l3_agent_extensions_api to
neutron-lib.  This is because that specifically has a long dependency
chain that ends up requiring agent/[linux,windows]/utils.py, which
should be migrated separately.

Change-Id: I7255a5ae6b706c09acecc0dea5dbd2febae0c282
Needed-By: I6d2cff03207924c7492c6136d4b21a9817769c67
Needed-By: If9235c1cf39b8ad2ef049e8154b82736e1f1d763
Needed-By: Ie8f0e70b11435d627f73e3fed45f946e863e90bc
Needed-By: Ia5962acfd737b4b350b94591802928a5a4dc53fb
2016-12-16 06:41:25 -07:00
Nate Johnston
bddc699eef Add validator to check for IP or subnet or none
This adds a validator to check if a value is an IP address, an IP
subnet, or none.

This was originally part of the neutron-fwaas API definition migration
to neutron-lib[1], but it was suggested that this should be pulled into
a separate change.

[1] https://review.openstack.org/389388

Change-Id: I8dcf49adc7754d0c9aa0479ede2de481325bb3e3
2016-12-15 16:31:21 +00:00
Boden R
c61976b66d Use new checks in hacking 0.12
Neutron recently updated their usage of hacking to use
version 0.12 [1] that now contains the hacking check
check_delayed_string_interpolation who's off_by_default
value is initially True (i.e. disabled). This hacking check
is defined in neutron_lib, but hasn't been registered in our
factory and isn't being consumed directly [2].

This patch takes a simple approach to reusing openstack-dev
hacking checks:
- Removes all traces of neutron-lib's version of the check; no one is
using it [2].
- Bumps our version of hacking to use  0.12 so we can use the checks
in that release.
- Enables the check via enabled extensions in tox.ini as neutron did [1].
- Updates our hacking check usage, noting that adopters should
enable the same extensions we do (via tox.ini).

[1] https://review.openstack.org/#/c/394817/
[2] http://codesearch.openstack.org/?q=check_delayed_string_interpolation&i=nope&files=&repos=

Change-Id: Ie9448317855b9cba6092cd0f63b77d26a562a5c9
2016-12-15 07:03:58 -07:00
Boden R
d1a5ea03c2 Separate hacking check factories
Neutron-lib adopters should be using neutron-lib's hacking
checks (factory) to validate compliance, but are susceptible
to breakage when new checks are released in neutron-lib (see
partial bug). What we need is a way to roll-out adopter hacking
checks in a controlled manner, giving consumers the opportunity
and tools to comply with new checks.

This patch begins to address this need by:
- Separating neutron-lib hacking checks into 3 separate factories;
adopter, incubating and neutron-lib internal (private).
- Moving any existing checks into their respective factory.
- Updating the usage docs on how to adopt our hacking checks.
- Trusty ole unit test; for obvious reasons.

This patch plays a part in a longer term hacking check strategy:
- Adopters must run neutron-lib's hacking check factory() or its
equivalent via their pep8 checks. This is part of their pep8 gate job
once they update their tox.ini to use neutron's factory().
- Adopters must run a non-voting neutron-lib-pep8-incubating gate job
that runs pep8 with neutron-lib's incubating_factory(). This is means
to warn adopters of upcoming checks without failing their gates.
This job will be created (by me) assuming reviewers agree to this approach.
- We'll communicate hacking checks via the standard means (see usage
docs herein).

Closure of Bug #1609478 will follow completion of the strategy above.

Partial-Bug: #1609478
Change-Id: I5b8d5c41f1bf463109baf9c26ae9d9db5719097d
2016-12-07 14:38:39 -07:00
Jenkins
c09f791071 Merge "Add converter to convert IPv6 addresses to canonical format" 2016-12-07 02:08:48 +00:00
Reedip
a18de8bb39 Add converter to convert IPv6 addresses to canonical format
With respect to Section-4 of [1], the following patch adds
a function to compress the extended IPv6 address passed to
the neutron server to its canonical form. This allows
compressed IPv6 addresses to be stored and remove any
leading zeroes in the IPv6 addresses.

Non-canonical IPv6 address formatted inputs wont be blocked,
but the addresses would be normalized to canonical formats.

[1]: http://tools.ietf.org/html/rfc5952

Partial-Bug: #1531103
Change-Id: Ic9afa5f90fba783748f7c56e8fba02e06af69748
2016-12-06 03:11:33 +00:00
Henry Gessau
c26dc8da98 Add alembic branch constants
These must be available in neutron-lib so that subprojects can
remove their dependency on neutron.db.migration.cli.

Change-Id: I78b37534cba0fd9740b5290c72ec6150d0de07c8
2016-11-28 13:51:24 -05:00
Jenkins
72eb43ee21 Merge "Move get_random_mac into neutron-lib" 2016-11-24 20:16:57 +00:00
Henry Gessau
60e9415c88 Use api/attributes.py instead of api/utils.py
Lets stop this habit now.

Change-Id: I0d3f7041cbe4fb762d6266dec6b4837640734cdf
2016-11-18 11:19:55 -05:00
Trevor McCasland
ee0f5b2ab2 Move get_random_mac into neutron-lib
get_random_mac is used by networking-ovn, tap-as-a-service,
neutron-vpnaas, and vmware-nsx, so we should move it into the
neutron-lib repository.

Change-Id: I391300e6f1d04b2413084bccdbacb038071c4509
2016-11-13 00:21:34 +00:00
Armando Migliaccio
96b69b27db Add missing is_loaded() method on directory's interface
It is not supercritical, but it is nice to have.

Change-Id: Iaf6c6c8d06ab1ea120da6957a5b3b6f1758f8550
2016-11-10 12:11:39 -08:00
Jenkins
efd7a3a5fa Merge "Add release note for plugin directory" 2016-11-03 03:50:10 +00:00
Nate Johnston
bbd71c45c6 Add ExtensionDescriptor to neutron-lib
When a subproject wants to create a class to extend the Neutron API,
that class inherits from ExtensionDescriptor.  This change pulls
ExtensionDescriptor over to neutron-lib so that subprojects can inherit
from it.  This class is almost entirely abstract.

This is used by nearly every neutron stadium project.

Change-Id: I4e9ba9c0c7fd4c5f449f11b4f401fa265ae7ea43
2016-11-01 21:33:02 +00:00
Armando Migliaccio
b95c1dd6cb Add release note for plugin directory
Change-Id: I620c13c7a83f17ae13b03e9c2a52864c154fbdf8
2016-10-28 07:58:00 +00:00
Armando Migliaccio
0e80e41250 Initial seed for neutron-lib release notes
Documenting latest additions like trunk API reference.

Change-Id: Ia3630a52c181cfe3986c0350630ea7281d9c62ad
2016-10-21 15:23:56 -07:00
Armando Migliaccio
4fbf12151c Add release notes target
Release notes for neutron-lib are meant to address neutron
developers and help them identify changes from one release
to another.

Change-Id: I51d2049643d3b35484d07f2f4aad7765f6dac958
2016-10-20 11:22:32 -07:00