html_last_updated_fmt option is interpreted as a
byte string in python3, causing Sphinx build to break.
This patch makes it utf-8 string.
Change-Id: I261fc5fecad14dd1e9c37877388bc91d8a18b26d
Closes-Bug:#1693670
This patch rehomes a bulk of neutron.api.v2.attributes into lib
with the following notable aspects:
- A new AttributeInfo class is available and wraps a resource's
attribute dict to provide operations with the attributes. The
class can be used as a operational wrapper on a dict of attrs, or
it an be used as a transport of attrs based on the consumer's need.
- A global singleton attribute map RESOURCES is available and
is initially populated with core resources.
- Some unit tests are beefed a little and make them more modular.
- Some huge comments into the devref.
- The fixture for API defs is updated to support backing up the
global RESOURCES dict.
Change-Id: Ic455e1af2796e58025381160dc5c3b83217413fa
Now that we have a single hacking check factory in lib [1],
we've followed-up by enhancing the neutron-lib periodic job
to include pep8 checks (see depends on patch). This patch
makes a few doc clarifications as to the pep8 inclusion in the
job.
[1] I0a8b39052c0f81f2ecbab3923353be1537b89a65
Change-Id: I035ffa8d34b0ebdabf730e99200739365f041343
Depends-On: I9bb173071abcbc5078a3fd728c41c34bf1b83ca2
Today we have a number of extensions that must provide
boilerplate/redundant code in their extension class to return
basic API definition attributes such as name, description, alias,
etc.. For example [1].
This patch proposes we can provide most of that boilerplate code
right in a base extension descriptor class; just have extension
sub-classes provide their API definition. With this patch, code such
as [1] gets reduced to a class definition with a single class-level attribute
to specify the API definition for the extension.
For sample usage, have a look at [2] that used as a dummy patch
to test PS4/PS7 of this change with neutron master.
[1] https://review.openstack.org/#/c/421562/2/neutron/extensions/providernet.py@36
[2] https://review.openstack.org/#/c/433929/1/neutron/extensions/providernet.py
Change-Id: I25135b39a1d26c11006bc2a7b6080cdd839f0085
While the intention of the incubating hacking check
factory was to provide a means to roll-out new checks
without breaking consumers [1], the complications involved
with running 2 factories in a gate job [2] perhaps negate
the benefits of this approach.
Therefore, as per discussion with Armando (see the neutron
IRC logs from Jan 9, 2017 at 18:58) this patch proposed
we only have a single hacking check factory for all consumers.
The implications are as follows:
- All new adopter hacking checks go into the single factory.
- Consumers failing the new pep8 hacking check will
see the failure via neutron-lib periodic job.
- Consumers fix failures ASAP.
IFF a special case arises and we need to release neutron-lib
before consumers adopt check(s), we can comment them
out of the factory to mitigate as a whole. Or individual
consumer project's can 'ignore' failing checks as outlined
in the usage.rst of this patch.
This patch updates the dev-ref as well as the code to
implement the above scheme.
[1] https://review.openstack.org/#/c/350723/
[2] https://review.openstack.org/#/c/412628/
Change-Id: I0a8b39052c0f81f2ecbab3923353be1537b89a65
A link in the review guidelines is invalid and when
referenced results in a "Not Found". This patch
fixes the link.
Change-Id: I2418d6776c748d33fef76870a6569a953b2cf550
The gating on python 3.4 is restricted to <= Mitaka. This is due to
the change from Ubuntu Trusty to Xenial, where only python3.5 is
available. There is no need to continue to keep these settings.
Change-Id: I9701f7ac1551dc60f0f75f64a322a6841108dfe2
Sphinx module index docs won't be generated unless a
module level docstring is included (ex [1]) with class refs.
As we don't include such module level refs in neutron-lib,
nothing is generated and thus no py-modindex.html
is created. This results in a dead link in our devref (see
bug report).
This change removes the modindex ref from our devref's
index to account for this fact. In the future if we wish to
add module documentation to support generation of
modindex we can add the ref back into our index.
[1] https://github.com/openstack/neutron/blob/
master/neutron/neutron_plugin_base_v2.py#L19
Change-Id: I4dbf473a9dc6540ef7cb16febd6703aa21f5a0b1
Closes-Bug: #1656346
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