Commit Graph

47 Commits

Author SHA1 Message Date
Vu Cong Tuan
ef21b57989 Fix html_last_updated_fmt for Python3
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
2017-06-04 12:27:34 +07:00
Dongcan Ye
a64b97da84 Remove duplicated "set of"
TrvialFix

Change-Id: Ib539b863c9daae58094e0ec85b837ca3e4285486
2017-05-17 15:09:35 +08:00
Boden R
e4016525ad Rehome neutron.api.v2.attributes
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
2017-04-25 11:27:49 -06:00
Boden R
7d6fed5dc2 Clarify pep8 inclusion in periodic job
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
2017-03-14 07:53:18 -06:00
Jenkins
4f8e5352b0 Merge "Use a single hacking check factory" 2017-03-04 02:33:56 +00:00
Boden R
dd4ffe3721 boilerplate extension descriptor for api-def
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
2017-02-28 06:19:32 -07:00
Boden R
de568b8a1c Use a single hacking check factory
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
2017-02-27 13:35:23 -07:00
Boden R
85b390e34a fix broken link in review guidelines
A link in the review guidelines is invalid and when
referenced results in a "Not Found". This patch
fixes the link.

Change-Id: I2418d6776c748d33fef76870a6569a953b2cf550
2017-02-10 16:05:28 -07:00
Cao Xuan Hoang
12c3a82756 Remove support for py34
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
2017-02-09 08:28:56 +07:00
Boden R
47f482468b Remove devref modindex ref
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
2017-01-27 12:24:52 -07:00
Jenkins
8b3a74c8b9 Merge "Expose/Improve callback notification interface" 2017-01-12 19:02:07 +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
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
bd9acbf387 Merge "Doc olso config option approach" 2016-12-28 10:00:53 +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
Jenkins
f4f8422c75 Merge "Remove README from docs build" 2016-12-06 00:10:20 +00:00
Boden R
de7aff63b8 Remove README from docs build
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
2016-11-30 15:07:46 -07:00
Armando Migliaccio
5c638b563b Explain how to use the latest neutron-lib dashboard
Change-Id: I18054b8f1238ee3cc6b8ce88bc9ed7e2e9de9a82
2016-11-30 11:24:01 -08:00
Jenkins
22e1a03154 Merge "Update contributing doc" 2016-11-23 09:33:58 +00:00
Boden R
8b017d1e15 Update contributing doc
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
2016-11-22 15:14:49 -07:00
Boden R
3225a572b7 Doc olso config option approach
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
2016-11-17 12:03:52 -07:00
Tony Xu
3c4196041d Fix doc build if git is absent
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
2016-10-27 18:11:36 +08:00
Armando Migliaccio
e1bda4ea85 Revise coverage guidelines
Blind 100% unit coverage hinders developement and has
no added benefits, especially  when coverage can be
achieved by other means.

Change-Id: I216286fd55ea6a6a71a01f56c918bf04298ef5f6
2016-10-20 11:39:17 -07:00
Reedip
bb397dfddc Trivial DevRef Spelling corrections
Small nits fixed.

TrivialFix

Change-Id: I144cada955783e9102e83e03961df2eabea25c7a
2016-08-25 12:36:03 +05:30
Henry Gessau
27cfad9210 Revert "Update hacking check consumption"
This reverts commit 4f318bc253.

Conflicts:
        neutron_lib/hacking/checks.py
        neutron_lib/tests/unit/hacking/test_checks.py
        test-requirements.txt

Change-Id: I383e2cfee3edac7201498f685e4c3b16f38af237
2016-08-09 21:52:45 -04:00
Boden R
4f318bc253 Update hacking check consumption
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
2016-08-02 08:57:18 -06:00
Jenkins
27407c7542 Merge "devref for public API docstring" 2016-07-21 15:56:29 +00:00
Boden R
0316d00209 devref for public API docstring
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
2016-07-21 04:52:23 -06:00
Jenkins
9025938e31 Merge "Document release steps for neutron-lib" 2016-07-14 14:17:57 +00:00
Armando Migliaccio
5cdbb047b2 Document release steps for neutron-lib
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
2016-07-13 17:13:53 -07:00
Gary Kotton
9157ed503b Update documents to address some issues
Issues:
1. typo 'Defintions' => 'Definitions'
2. change 'the the' => 'the'

TrivialFix

Change-Id: I71f6b3159520ca5d80e4758a34389854f1b05c7d
2016-06-29 05:30:29 -07:00
Boden R
112eef63e2 Forbid eventlet based code
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
2016-06-21 14:33:36 -06:00
Henry Gessau
1cb77081b0 TrivialFix: Fix a bad indentation in a doc file
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
2016-06-09 16:22:11 -04:00
Andreas Jaeger
8704bae76f Remove unused pngmath Sphinx extension
There's no RST file that uses ".. math" and thus
the pngmath Sphinx extension is not used and can
get removed.

Change-Id: I3ea4b529025c8ac3c4092f3720124647861e6668
2016-02-29 19:55:59 +01:00
Doug Wiegley
285236706a Move some common test and framework goo into neutron-lib
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
2016-01-29 23:45:49 -07:00
Jenkins
50546e95ec Merge "Replace deprecated library function os.popen() with subprocess" 2016-01-27 01:48:33 +00:00
Paul Michali
7d9980f7ca API validators and converters
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
2016-01-15 12:44:09 +00:00
Harshada Mangesh Kakad
da8ed114cc Replace deprecated library function os.popen() with subprocess
os.popen() is deprecated since version 2.6. Resolved with use of
subprocess module.

Change-Id: I0072000a1386aaa5d3eacef4bfb9dc74edb915ec
Closes-Bug: #1529836
2016-01-14 05:26:52 -08:00
Paul Michali
3d41d2e8e5 Adding callback mechanism
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
2015-12-18 19:05:15 +00:00
Paul Michali
64211231be Setup for devref documentation
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
2015-12-07 18:50:07 +00:00
Doug Wiegley
447531ff45 Insert references to debtcollector in review guidelines
Change-Id: Ib63da82d628333bc11c4764416c702429ad38dac
Partially-Implements: blueprint neutron-lib
2015-11-23 17:34:33 -07:00
Doug Wiegley
f696b74579 Beginning of lib review guidelines
Partially-Implements: bp neutron-lib

Change-Id: I83ccbf3d0df80a537ce403922adfbca7ea567cf4
2015-11-23 14:48:20 +00:00
Doug Wiegley
b0d12660ea Initial cookiecutter commit
Partially-Implements: bp neutron-lib
Change-Id: Ia6884f545efb56429bcb74246a74e95d1318376a
2015-11-20 17:24:43 -07:00