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
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
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
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
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
Change [1] introduced a remote image link in our
README.rst. Due to the fact that we include this
README in our docs, our 'tox -e docs' build now
fails due to the nonlocal image URI as we run the
sphinx build with -W:
--
Warning, treated as error:
README.rst:None: WARNING: nonlocal image URI found:
http://governance.openstack.org/badges/neutron-lib.svg
--
Ignoring specific warnings is supported with newer
versions of sphinx [2], but not with the version we
currently use.
Therefore this patch removes our readme reference
from our doc/source/ tree.
[1] https://review.openstack.org/#/c/402702/
[2] https://github.com/sphinx-doc/sphinx/issues/2466
Change-Id: I8458635f7081ea98a160cbb4105032d435bdcb98
Rehoming code into neutron-lib isn't always a straight
forward process. This patch updates our contributing
and index doc source to include a high-level workflow
for such situations.
Change-Id: I9c678b4e3223c5c44b840029102e73ab5111e268
This update to the review guidelines, captures at a high
level the discussion Armando and I had regarding how
oslo config options should be rehomed to neutron-lib.
For more details search for 'common config options' in
[1].
[1] http://eavesdrop.openstack.org/irclogs/%23openstack-
neutron/%23openstack-neutron.2016-11-17.log.html
Change-Id: I31990a793690d3ed7b3ab588c213d453959d93bf
When building packages if git is absent, then we should not set
html_last_updated_fmt. It can still be set via the -D switch
when building with sphinx-build.
Closes-Bug: #1552251
Change-Id: I9465e116e52517fecc651ef01d8e3fc7b78b7e48
Blind 100% unit coverage hinders developement and has
no added benefits, especially when coverage can be
achieved by other means.
Change-Id: I216286fd55ea6a6a71a01f56c918bf04298ef5f6
This patch updates our hacking checks as follows:
- Hacking checks are now registered via entry points so
they can be used via flake8 CLI. By default they are disabled.
Hacking check doc string is also updated to support pep8
parsing of check code.
- The existing hacking.checks.factory() is moved to a more
meaningful name; marking as deprecated.
- A private neutron-lib specific hacking check factory is provided
and used in tox.ini.
- A flake8 plugin is provided that supports the ability to use our
hacking check factory functions to enable a pre-existing check
by default.
- Our usage of hacking checks is updated to reflect our consumption
model for adopters.
- Unit tests are provided.
Change-Id: I88dad7f7cce4d4f5af679272f067c3bb4a73803a
This patch updates our review guidelines with respect to
public API docstrings. While we want to encourage docstrings,
we don't want hard enforcement that may result in a raised
entry barrier for lib contributors.
I'll investigate the ability to implement a warn-only hacking check
for docstrings. This would allow us to identify and cleanup
pydoc "debt" if we desired.
Change-Id: I73734e4acc34ed7716e3daceb664cebbf045c8ff
To avoid wide breakage when a new release of neutron-lib
is published, a trick can be exploited in order to catch
the failures ahead of time. This patch documents the
trick as conceived by dougwig's diabolical mind.
Change-Id: I301ff9f945eeb1a90be63d6610f375627f077aa8
As per [1], we are not going to accept code that uses/imports
eventlet into neutron-lib. This patch adds devref indicating such
so that everyone is on the same page.
[1] https://review.openstack.org/#/c/331547/
Change-Id: I7f513ad9eb783cb685fec25af4c3cbd5dbbfe0de
The doc build fails locally because it treats warnings as errors.
(In the gate, treating warnings as errors is waiting for [1].)
[1] https://review.openstack.org/229951
Change-Id: I84ab0de7a89dca1d53d0a5157d83aff0a1c31d95
There's no RST file that uses ".. math" and thus
the pngmath Sphinx extension is not used and can
get removed.
Change-Id: I3ea4b529025c8ac3c4092f3720124647861e6668
Also fix an issue with ignoring some of the unit tests, moving them all
under the right subdir, and do not overload the tests.base name.
This commit used to contain the move of the rpc code, but that is now
in a child commit.
Partially-Implements: blueprint neutron-lib
Change-Id: Iae9fe970cd2a76305a74804d93a912e476060f1e
This brings over the validation and convert_to methods from Neutron.
Additional tests were added to improve coverage, and some supporting
methods were added for these.
Renamed validators to remove underscore, so that they can be imported
into neutron/api/v2/attributes.py.
Added devref docs to help developers in creating and using validators
and converters.
Change-Id: I81394dff69b816146e521bcd3e9641761178d6fd
Implements: blueprint neutron-lib
os.popen() is deprecated since version 2.6. Resolved with use of
subprocess module.
Change-Id: I0072000a1386aaa5d3eacef4bfb9dc74edb915ec
Closes-Bug: #1529836
Adding the callback mechanism to neutron-lib. Added code, test, and
devref. Added additional test coverage. Added missing __init__.py
files so tests are run. Needed oslo.log added to requirements.
Once this is upstreamed, we can modify the callback mechanism.
Change-Id: Ib16f3942e8ac2ddbfc8ff6919863ec9ad197e5b6
Implements: blueprint neutron-lib
Setup the docs target for producing documentation, create the needed
index files for documentation and devref, and include references to
the existing .rst docs.
Change-Id: Id2a23058ee5aa557fb52b65f044bac4528ef86bc
Implements: blueprint neutron-lib