Compare commits

..

43 Commits

Author SHA1 Message Date
Andreas Jaeger
ac04e5d415 Cleanup py27 support
Make a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Remove html_last_updated_fmt from conf.py, this is not needed with
  openstackdocstheme anymore; update openstackdocstheme requirement

Change-Id: I66d7b502349de38bc2b646ed99cf5a41471d81bf
2020-04-04 17:06:45 +02:00
zhanghao
bb5b9cac6e Replace 'bgp speaker show dragents' with 'bgp dragent list'
In order to follow other agent related commands in OSC, it is more
appropriate and friendly to replace 'bgp speaker show dragents' with
'bgp dragent list'. this patch uses 'openstack bgp dragent list' to
show the list of dragents, and the optional parameter 'bgp-speaker'
shows the list of dragents hosting a specific bgp speaker.

Change-Id: I9e0703fccf535b1e1a2055ed917336055b7395f5
Closes-Bug: #1858377
2020-02-17 14:49:41 +00:00
zhanghao
b3fa5e530b Drop lib-forward-testing
Change-Id: Ifdce9146e8233e6760ee6c0009338661f90848a2
2020-01-25 04:26:20 -05:00
Stephen Finucane
59145be07e Add support for port bindings
The port bindings API has been around since Pike but has never been
exposed via neutronclient. We still use this in nova so it would be nice
to avoid having to create a KSA client manually for this stuff. We don't
need to expose things via the UI, just the client itself, so do that.

Change-Id: Ied1a057186f0819166df84725b09ded314930a1d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Sem-Ver: feature
2020-02-10 10:29:47 +00:00
Jay Faulkner
946ac3ed2e Convert exception to string before passing it in
Before this change, neutronclient was passing in a raw exception
as a kwarg to the ConnectionFailed exception. This caused an
exception to be raised in _safe_decode_dict() due to the exception
not being a text type.

Now, we explicitly convert the raw exception to a string before
passing it as a kwarg.

Closes-bug: 1859068
Change-Id: I323b3aceec0a937874eabf770fbc82995202f6d6
2020-01-14 15:33:30 +00:00
Rodolfo Alonso Hernandez
a363edd761 Avoid py36 error when printing unicode chars in a stream
The IOStream was not able to encode characters out of range 128:
  "UnicodeEncodeError: 'ascii' codec can't encode characters in
   position 19-21: ordinal not in range(128)"

Change-Id: Ic95396a5cf73c49d332928857dc064819a6d7ea6
Closes-Bug: #1858421
2020-01-10 18:57:25 +00:00
liushuobj
29043825e7 fix a typo
Change-Id: I9d82335c37f114aa43f26dec106e7598e776e068
2019-12-27 16:36:30 +08:00
Zuul
918b590fbf Merge "Drop python3 hack for XML serializer" 2019-12-21 23:37:06 +00:00
Zuul
1168458db2 Merge "Drop python 2.7 support" 2019-12-21 23:37:06 +00:00
Akihiro Motoki
91fb009706 Fix pep8 errors with hacking 2.0.0
Change-Id: I4737d4bc4fa116f45e2361eba93f48feae0161a4
2019-12-17 16:39:14 +09:00
Akihiro Motoki
010053df07 Drop python 2.7 support
We no longer support python 2.7 past Train.
Let's stop testings with python 2.7 and drop python 2.7 stuffs.

pypy in tox.ini is also dropped too. It is not used for long.

Change-Id: I8a07c007a129cd2141085a1a3cc7f81658c42db2
2019-12-17 14:46:06 +09:00
Akihiro Motoki
d5c516a5a2 Drop python3 hack for XML serializer
It was added in https://review.opendev.org/#/c/110947/
to make the XML serializer work in python 3.
We dropped the XML serializer support long ago.
I believe we can drop it safely.

Change-Id: I208de891515cb2cbdde779013ba58f19e36fc55c
2019-12-17 14:43:05 +09:00
Zuul
e68234ecf6 Merge "Move grenade neutron-lib job to py3 and in python-neutronclient repo" 2019-12-11 23:45:19 +00:00
Ghanshyam Mann
c430ed8950 Move grenade neutron-lib job to py3 and in python-neutronclient repo
'legacy-grenade-dsvm-neutron-libs' grenade neutron-lib jobs
is present in opensatck-zuul-jobs repo running on python 2. This needs
to run on py3 from Ussuri onwards and py2 for stable/branch.

python-neutronclient is the only repo which is using this job.

py2 version has been kept in opensatck-zuul-jobs and for ussuri
onwwards this has been migrated to python-neutronclient repo with
py3 version.

Change-Id: I165f86e1d05c8830e0b75b5c2db369178a3df7e7
2019-12-09 09:20:20 +01:00
kangyufei
40996e50ea Switch to Ussuri jobs
Change-Id: I59807606d4865cb2f4d9c6a912f659ea45b3fba8
2019-10-22 17:05:41 +08:00
Zuul
f46bf7eca0 Merge "PDF documentation build" 2019-10-07 17:33:23 +00:00
zhanghao2
ee08644c5f Remove 'public' and 'private' parameters in fwaas_v2
The 'public' and 'private' parameters have been replaced
with 'share' and 'no-share' parameters in the Pike version,
they can be removed now.

Change-Id: I57a2e228ec1cdb6ed259914abc38bdada036d369
2019-10-01 05:21:19 -04:00
f61cd94e11 Update master for stable/train
Add file to the reno documentation build to show release notes for
stable/train.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/train.

Change-Id: I1dd2ee12854ac7a55baa2114230ab42404dea5c1
Sem-Ver: feature
2019-09-20 17:41:48 +00:00
Zuul
115f60f005 Merge "Add router add/remove extra routes operations" 2019-09-13 12:34:03 +00:00
Bence Romsics
1c634ed2c1 Add router add/remove extra routes operations
Add methods to the client to call the two new member actions introduced by
new Neutron extension: extraroute-atomic.

Change-Id: Idb1fa073c2ff31f566b376cfa4f63cf27fecec86
Partial-Bug: #1826396 (rfe)
Related-Change: https://review.opendev.org/655680 (spec)
2019-09-13 09:07:19 +00:00
Akihiro Motoki
d6c78a5d39 PDF documentation build
Change-Id: I0abc5df1dfde23756bc2fd78631141ba685dc6fe
Story: 2006099
Task: 35139
2019-09-05 12:27:30 +00:00
jiasirui
e35b3c160b Improve help text
Change-Id: Idc8f55567d0d4c95968d34d3b7aa95048623d9d0
2019-08-30 08:28:22 +08:00
Oleg Bondarev
62f4868e6e Fix string in header
Commit ab426a791a changed
sha1 to sha256.
Need to change string correspondingly

Change-Id: I8b35350c32ab551d513f21325931d6697f62fb2f
Related-Bug: #1759250
2019-08-20 15:17:30 +04:00
Oleg Bondarev
ab426a791a Use secure sha256 instead of sha1
Fix for bandit B303: Use of insecure MD2, MD4, MD5, or SHA1 hash function.

Change-Id: I00403d7bd3b40ae00420e6cddcf40f45488284a9
Partial-Bug: #1759250
2019-08-13 18:12:19 +04:00
Akihiro Motoki
1a8fdf355d Switch functional job to python3
Change-Id: I7aa4566b8f2c81da6a00e664908506f5628cd0a1
2019-07-24 23:00:09 +09:00
Akihiro Motoki
6330cc1980 Convert legacy functional jobs to zuulv3
This commit merges the legacy functional test jobs (core and adv-svcs)
into neutronclient-functional. FWaaS v1 was dropped in Stein and
adv-svcs job now checks only VPNaaS, so it looks too much to have
a separate job for VPNaaS.

Note that tls-proxy is disabled as the base class for functional tests
(neutronclient.tests.functional.base.ClientTestBase) does not support
HTTPS endpoints. This can be tackled separately.

Change-Id: I714efd1bc14cbba85f7b4caf6834ce375ff89547
2019-07-24 22:42:54 +09:00
Zuul
6ea4cb57dd Merge "Run functional test correctly" 2019-07-19 09:13:51 +00:00
Akihiro Motoki
2af19d55d6 Run functional test correctly
legacy-neutronclient-test-dsvm-functional job actually runs
neutronclient.tests.unit because .stestr.conf does not honor
OS_TEST_PATH. This commit fixes .stestr.conf to honor OS_TEST_PATH
specified in tox.ini.

Also fixes the logic of is_extension_enabled() in ClientTestBase
to check whether FWaaS v1 (fwaas) is enabled correctly.
Previously the logic checks a substring of a specified extension,
so 'fwaas' (FWaaS v1) matches 'fwaas_v2' (FWaaS v2),
which leads to a failure of FWaaS v1 CLI tests.

Change-Id: I958ad496b16cca8d03a7b84ebf5f8f031e4248ea
2019-07-18 20:28:55 +09:00
zhanghao2
34924865b3 Add friendly event hints for logging
When creating a network log with the '--event' parameter, it is
impossible to know which parameter values can be specified, and it
is necessary to add a prompt.

Change-Id: I6aa4f95b650cdc7b04e74b851a78a2ae42fc288a
2019-07-16 22:47:48 -04:00
Corey Bryant
cf95be3ea5 Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: If79694b32ece897c93d1889da28daff641e46f1c
Story: #2005924
Task: #34225
2019-07-08 08:14:07 +00:00
Zuul
d40f4cc96b Merge "doc: Remove prompt from python binding examples" 2019-06-19 22:20:52 +00:00
Akihiro Motoki
e2ee92e2e1 Blacklist bandit 1.6.0 due to directory exclusion bug
Bandit 1.6.0 introduces a regression[0] with the -x option,
a fix is expected to be included in 1.6.1 soon.

This commit also aligns Sphinx requirement with the requirements
project [2]. This is required to pass requirements-check.
The lower bound for sphinx was missing and requirements-check
now requires it, so the lower bound sphinx >=1.6.2 was added.

[0] https://github.com/PyCQA/bandit/issues/488
[1] https://github.com/PyCQA/bandit/pull/489
[2] https://review.opendev.org/#/c/657890/

Change-Id: I937cfa722f5234ca4d5506047001d9cb07728cd8
2019-05-28 16:15:14 +09:00
Akihiro Motoki
dc10f44128 doc: Remove prompt from python binding examples
The current python binding examples have prompts of python
interactive mode, but these prompts make it difficult to
copy-and-paste the examples. This commit removes them.

Change-Id: Ia5d35fbb585ed0d0d11c8d035196981e9dd46785
2019-05-10 11:00:42 +09:00
Zuul
209e1801ac Merge "Replace git.openstack.org URLs with opendev.org URLs" 2019-05-02 04:23:04 +00:00
Zuul
88c660dbe8 Merge "Dropping the py35 testing" 2019-05-01 02:46:15 +00:00
jacky06
9a91b4ad38 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I3cc418bd8219a3d4f3ab5c018adf06b66ef36b46
2019-04-28 14:25:39 +08:00
OpenDev Sysadmins
b62a1cd1a4 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:44:46 +00:00
Ghanshyam Mann
da62ba3029 Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I612c7c40e07f23afa920c92bf4b51b278282dd9d
2019-04-15 16:33:41 +00:00
Zuul
f0c886cbe7 Merge "Replace openstack.org git:// URLs with https://" 2019-03-27 01:05:30 +00:00
Ian Wienand
d572f2cdd2 Replace openstack.org git:// URLs with https://
This is a mechanically generated change to replace openstack.org
git:// URLs with https:// equivalents.

This is in aid of a planned future move of the git hosting
infrastructure to a self-hosted instance of gitea (https://gitea.io),
which does not support the git wire protocol at this stage.

This update should result in no functional change.

For more information see the thread at

 http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003825.html

Change-Id: I15a69bcf6d51bfb1d5ade8f5119bb77bb2387f77
2019-03-24 20:35:53 +00:00
Zuul
4cbf6ddc66 Merge "add python 3.7 unit test job" 2019-03-22 07:23:36 +00:00
ca875adf38 Update master for stable/stein
Add file to the reno documentation build to show release notes for
stable/stein.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/stein.

Change-Id: I9add4f457af409830f3faff0af2661e0b3909b40
Sem-Ver: feature
2019-03-18 14:53:55 +00:00
Corey Bryant
b4a0e27ec6 add python 3.7 unit test job
This is a mechanically generated patch to add a unit test job running
under Python 3.7.

See ML discussion here [1] for context.

[1] http://lists.openstack.org/pipermail/openstack-dev/2018-October/135626.html

Change-Id: Icb961e81e0d99ab1912f75b1ce83ed371fc1107c
Story: #2004073
2019-02-20 15:39:26 -05:00
44 changed files with 521 additions and 218 deletions

View File

@@ -2,4 +2,3 @@
host=review.opendev.org
port=29418
project=openstack/python-neutronclient.git
defaultbranch=stable/stein

View File

@@ -1,3 +1,3 @@
[DEFAULT]
test_path=./neutronclient/tests/unit
test_path=${OS_TEST_PATH:-./neutronclient/tests/unit}
top_dir=./

View File

@@ -2,35 +2,70 @@
templates:
- openstack-cover-jobs
- openstack-lower-constraints-jobs
- openstack-python-jobs
- openstack-python35-jobs
- openstack-python36-jobs
- openstack-python3-ussuri-jobs
- publish-openstack-docs-pti
- check-requirements
- lib-forward-testing
- lib-forward-testing-python3
- release-notes-jobs-python3
- openstackclient-plugin-jobs
check:
jobs:
- legacy-neutronclient-test-dsvm-functional:
irrelevant-files: &project-irrelevant-files
- ^.*\.rst$
- ^doc/.*$
- ^neutron/locale/.*$
- ^releasenotes/.*$
- legacy-neutronclient-test-dsvm-functional-adv-svcs:
irrelevant-files: *project-irrelevant-files
- neutronclient-functional
gate:
jobs:
- legacy-neutronclient-test-dsvm-functional:
irrelevant-files: *project-irrelevant-files
- legacy-neutronclient-test-dsvm-functional-adv-svcs:
irrelevant-files: *project-irrelevant-files
- neutronclient-functional
experimental:
jobs:
- legacy-grenade-dsvm-neutron-libs:
- neutron-lib-grenade-dsvm:
irrelevant-files:
- ^(test-|)requirements.txt$
- ^setup.cfg$
- job:
name: neutronclient-functional
parent: devstack-tox-functional
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
required-projects:
- openstack/python-neutronclient
- openstack/neutron
- openstack/neutron-vpnaas
vars:
tox_envlist: functional
devstack_services:
# NOTE: neutronclient.tests.functional.base.ClientTestBase does not
# support HTTPS endpoints now, so tls-proxy needs to be disabled.
tls-proxy: false
devstack_localrc:
USE_PYTHON3: true
LIBS_FROM_GIT: python-neutronclient
devstack_plugins:
neutron-vpnaas: https://opendev.org/openstack/neutron-vpnaas
- job:
name: neutron-lib-grenade-dsvm
# Old name: legacy-grenade-dsvm-neutron-libs
parent: legacy-dsvm-base
run: playbooks/legacy/grenade-dsvm-neutron-libs/run.yaml
post-run: playbooks/legacy/grenade-dsvm-neutron-libs/post.yaml
timeout: 10800
required-projects:
- openstack/grenade
- openstack/devstack-gate
- openstack/keystoneauth
- openstack/neutron
- openstack/neutron-lib
- openstack/os-client-config
- openstack/python-cinderclient
- openstack/python-glanceclient
- openstack/python-ironicclient
- openstack/python-keystoneclient
- openstack/python-neutronclient
- openstack/python-novaclient
# This is py3 version for ussuri onwards rest all branch needs to be py2
# version which is present in openstack-zuul-jobs.
# We need to take care of this branch variant and python version while
# migrating these jobs to zuulv3.
branches: ^(?!(stable/(ocata|pike|queens|rocky|stein|train))).*$

View File

@@ -32,6 +32,6 @@ provides a Python API (the ``neutronclient`` module) and a command-line tool
.. _Launchpad project: https://launchpad.net/python-neutronclient
.. _Blueprints: https://blueprints.launchpad.net/python-neutronclient
.. _Bugs: https://bugs.launchpad.net/python-neutronclient
.. _Source: https://git.openstack.org/cgit/openstack/python-neutronclient
.. _Source: https://opendev.org/openstack/python-neutronclient
.. _Developer's Guide: http://docs.openstack.org/infra/manual/developers.html
.. _Release Notes: https://docs.openstack.org/releasenotes/python-neutronclient

View File

@@ -1,7 +1,6 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
openstackdocstheme>=1.18.1 # Apache-2.0
openstackdocstheme>=1.32.1 # Apache-2.0
reno>=2.5.0 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD

View File

@@ -16,7 +16,6 @@ extensions = [
repository_name = 'openstack/python-neutronclient'
bug_project = 'python-neutronclient'
bug_tag = 'doc'
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -49,6 +48,25 @@ html_theme = 'openstackdocs'
# Output file base name for HTML help builder.
htmlhelp_basename = 'neutronclientdoc'
# -- Options for LaTeX output ------------------------------------------------
latex_documents = [
('index', 'doc-python-neutronclient.tex',
u'python-neutronclient Documentation',
u'Neutron Contributors', 'manual'),
]
# Disable usage of xindy https://bugzilla.redhat.com/show_bug.cgi?id=1643664
latex_use_xindy = False
latex_domain_indices = False
latex_elements = {
'makeindex': '',
'printindex': '',
'preamble': r'\setcounter{tocdepth}{5}',
}
# -- Options for cliff.sphinxext plugin ---------------------------------------
autoprogram_cliff_application = 'openstack'

View File

@@ -29,7 +29,7 @@ command-line interface (CLI), to the
`OpenStack Client (OSC) <https://github.com/openstack/python-openstackclient>`_
and the `OpenStack Python SDK <https://github.com/openstack/openstacksdk>`_.
This transition is being guided by the
`Deprecate individual CLIs in favour of OSC <https://review.openstack.org/#/c/243348/>`_
`Deprecate individual CLIs in favour of OSC <https://review.opendev.org/#/c/243348/>`_
OpenStack spec. See the `Neutron RFE <https://bugs.launchpad.net/neutron/+bug/1521291>`_,
`OSC neutron support etherpad <https://etherpad.openstack.org/p/osc-neutron-support>`_ and
details below for the overall progress of this transition.
@@ -56,16 +56,16 @@ Transition Steps
----------------
1. **Done:** OSC adds OpenStack Python SDK as a dependency. See the following
patch set: https://review.openstack.org/#/c/138745/
patch set: https://review.opendev.org/#/c/138745/
2. **Done:** OSC switches its networking support for the
`network <https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/network.html>`_
command object to use the OpenStack Python SDK instead of the neutron
client's Python library. See the following patch set:
https://review.openstack.org/#/c/253348/
https://review.opendev.org/#/c/253348/
3. **Done:** OSC removes its python-neutronclient dependency.
See the following patch set: https://review.openstack.org/#/c/255545/
See the following patch set: https://review.opendev.org/#/c/255545/
4. **In Progress:** OpenStack Python SDK releases version 1.0 to guarantee
backwards compatibility of its networking support and OSC updates
@@ -99,7 +99,7 @@ Transition Steps
developer guide section below for more information on this step.
7. **In Progress:** Deprecate the ``neutron`` CLI. Running the CLI after
it has been `deprecated <https://review.openstack.org/#/c/393903/>`_
it has been `deprecated <https://review.opendev.org/#/c/393903/>`_
will issue a warning message:
``neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.``
In addition, no new features will be added to the CLI, though fixes to

View File

@@ -33,23 +33,23 @@ information on this keystoneauth API, see `Using Sessions`_.
.. code-block:: python
>>> from keystoneauth1 import identity
>>> from keystoneauth1 import session
>>> from neutronclient.v2_0 import client
>>> username='username'
>>> password='password'
>>> project_name='demo'
>>> project_domain_id='default'
>>> user_domain_id='default'
>>> auth_url='http://auth.example.com:5000/v3'
>>> auth = identity.Password(auth_url=auth_url,
... username=username,
... password=password,
... project_name=project_name,
... project_domain_id=project_domain_id,
... user_domain_id=user_domain_id)
>>> sess = session.Session(auth=auth)
>>> neutron = client.Client(session=sess)
from keystoneauth1 import identity
from keystoneauth1 import session
from neutronclient.v2_0 import client
username='username'
password='password'
project_name='demo'
project_domain_id='default'
user_domain_id='default'
auth_url='http://auth.example.com:5000/v3'
auth = identity.Password(auth_url=auth_url,
username=username,
password=password,
project_name=project_name,
project_domain_id=project_domain_id,
user_domain_id=user_domain_id)
sess = session.Session(auth=auth)
neutron = client.Client(session=sess)
If you are using Identity v2.0 API (DEPRECATED), create an auth plugin using
the appropriate parameters and `keystoneauth1.identity` will handle Identity
@@ -58,38 +58,38 @@ like the previous example.
.. code-block:: python
>>> auth = identity.Password(auth_url=auth_url,
... username=username,
... password=password,
... project_name=project_name)
>>> # create a Session and a Neutronclient
auth = identity.Password(auth_url=auth_url,
username=username,
password=password,
project_name=project_name)
# create a Session and a Neutronclient
Now you can call various methods on the client instance.
.. code-block:: python
>>> network = {'name': 'mynetwork', 'admin_state_up': True}
>>> neutron.create_network({'network':network})
>>> networks = neutron.list_networks(name='mynetwork')
>>> print networks
>>> network_id = networks['networks'][0]['id']
>>> neutron.delete_network(network_id)
network = {'name': 'mynetwork', 'admin_state_up': True}
neutron.create_network({'network':network})
networks = neutron.list_networks(name='mynetwork')
print networks
network_id = networks['networks'][0]['id']
neutron.delete_network(network_id)
Alternatively, you can create a client instance using an auth token
and a service endpoint URL directly.
.. code-block:: python
>>> from neutronclient.v2_0 import client
>>> neutron = client.Client(endpoint_url='http://192.168.206.130:9696/',
... token='d3f9226f27774f338019aa2611112ef6')
from neutronclient.v2_0 import client
neutron = client.Client(endpoint_url='http://192.168.206.130:9696/',
token='d3f9226f27774f338019aa2611112ef6')
You can get ``X-Openstack-Request-Id`` as ``request_ids`` from the result.
.. code-block:: python
>>> network = {'name': 'mynetwork', 'admin_state_up': True}
>>> neutron.create_network({'network':network})
>>> networks = neutron.list_networks(name='mynetwork')
>>> print networks.request_ids
['req-978a0160-7ab0-44f0-8a93-08e9a4e785fa']
network = {'name': 'mynetwork', 'admin_state_up': True}
neutron.create_network({'network':network})
networks = neutron.list_networks(name='mynetwork')
print networks.request_ids
# -> ['req-978a0160-7ab0-44f0-8a93-08e9a4e785fa']

View File

@@ -46,7 +46,7 @@ msgpack-python==0.4.0
munch==2.1.0
netaddr==0.7.18
netifaces==0.10.4
openstackdocstheme==1.18.1
openstackdocstheme==1.32.1
openstacksdk==0.11.2
os-client-config==1.28.0
os-service-types==1.2.0

View File

@@ -104,13 +104,13 @@ class HTTPClient(object):
try:
resp, body = self.request(*args, **kargs)
except requests.exceptions.SSLError as e:
raise exceptions.SslCertificateValidationError(reason=e)
raise exceptions.SslCertificateValidationError(reason=str(e))
except Exception as e:
# Wrap the low-level connection error (socket timeout, redirect
# limit, decompression error, etc) into our custom high-level
# connection exception (it is excepted in the upper layers of code)
_logger.debug("throwing ConnectionFailed : %s", e)
raise exceptions.ConnectionFailed(reason=e)
raise exceptions.ConnectionFailed(reason=str(e))
utils.http_log_resp(_logger, resp, body)
# log request-id for each api call

View File

@@ -20,10 +20,6 @@ from neutronclient._i18n import _
from neutronclient.common import exceptions as exception
if six.PY3:
long = int
class ActionDispatcher(object):
"""Maps method name to local methods through action name."""

View File

@@ -31,7 +31,7 @@ def add_minimum_bandwidth_arguments(parser):
help=_('QoS minimum bandwidth assurance, expressed in kilobits '
'per second.'))
# NOTE(ralonsoh): the only direction implemented is "egress". Please,
# refer to the spec (https://review.openstack.org/#/c/316082/).
# refer to the spec (https://review.opendev.org/#/c/316082/).
parser.add_argument(
'--direction',
# NOTE(ihrachys): though server picks the default for us (egress), it's

View File

@@ -70,18 +70,25 @@ class RemoveBgpSpeakerFromDRAgent(command.Command):
class ListDRAgentsHostingBgpSpeaker(command.Lister):
"""List dynamic routing agents hosting a BGP speaker"""
"""(Deprecated) List dynamic routing agents hosting a BGP speaker
(Use "bgp dragent list" instead)
"""
resource = 'agent'
list_columns = ['id', 'host', 'admin_state_up', 'alive']
unknown_parts_flag = False
def get_parser(self, prog_name):
self.log.warning("The 'openstack bgp speaker show dragents' CLI is "
"deprecated and will be removed in the future. Use "
"'openstack bgp dragent list' CLI instead.")
parser = super(ListDRAgentsHostingBgpSpeaker,
self).get_parser(prog_name)
parser.add_argument('bgp_speaker',
metavar='<bgp-speaker>',
help=_("ID or name of the BGP speaker"))
help=_("List dynamic routing agents hosting a "
"BGP speaker (name or ID)"))
return parser
def take_action(self, parsed_args):
@@ -97,3 +104,39 @@ class ListDRAgentsHostingBgpSpeaker(command.Lister):
(utils.get_dict_properties(
s, columns, formatters=_formatters,
) for s in data['agents']))
class ListDRAgent(command.Lister):
"""List dynamic routing agents"""
resource = 'agent'
list_columns = ['id', 'host', 'admin_state_up', 'alive']
unknown_parts_flag = False
def get_parser(self, prog_name):
parser = super(ListDRAgent,
self).get_parser(prog_name)
parser.add_argument('--bgp-speaker',
metavar='<bgp-speaker>',
help=_("List dynamic routing agents hosting a "
"BGP speaker (name or ID)"))
return parser
def take_action(self, parsed_args):
search_opts = {}
client = self.app.client_manager.neutronclient
if parsed_args.bgp_speaker is not None:
search_opts = {}
speaker_id = client.find_resource(constants.BGP_SPEAKER,
parsed_args.bgp_speaker)['id']
search_opts['bgp_speaker'] = speaker_id
data = client.list_dragents_hosting_bgp_speaker(**search_opts)
else:
attrs = {'agent_type': 'BGP dynamic routing agent'}
data = client.list_agents(**attrs)
headers = ('ID', 'Host', 'State', 'Alive')
columns = ('id', 'host', 'admin_state_up', 'alive')
return (headers,
(utils.get_dict_properties(
s, columns, formatters=_formatters,
) for s in data['agents']))

View File

@@ -77,19 +77,6 @@ def _get_common_parser(parser):
action='store_true',
help=_('Detach egress firewall policy from the firewall group'))
shared_group = parser.add_mutually_exclusive_group()
shared_group.add_argument(
'--public',
action='store_true',
help=_('Make the firewall group public, which allows it to be '
'used in all projects (as opposed to the default, '
'which is to restrict its use to the current project). '
'This option is deprecated and would be removed in R release.'))
shared_group.add_argument(
'--private',
action='store_true',
help=_('Restrict use of the firewall group to the '
'current project. This option is deprecated '
'and would be removed in R release.'))
shared_group.add_argument(
'--share',
@@ -147,9 +134,9 @@ def _get_common_attrs(client_manager, parsed_args, is_create=True):
cmd_resource=const.CMD_FWP)['id']
elif parsed_args.no_egress_firewall_policy:
attrs['egress_firewall_policy_id'] = None
if parsed_args.share or parsed_args.public:
if parsed_args.share:
attrs['shared'] = True
if parsed_args.no_share or parsed_args.private:
if parsed_args.no_share:
attrs['shared'] = False
if parsed_args.enable:
attrs['admin_state_up'] = True
@@ -349,14 +336,6 @@ class UnsetFirewallGroup(command.Command):
dest='egress_firewall_policy',
help=_('Egress firewall policy (name or ID) to delete'))
shared_group = parser.add_mutually_exclusive_group()
shared_group.add_argument(
'--public',
action='store_true',
help=_('Make the firewall group public, which allows it to be '
'used in all projects (as opposed to the default, '
'which is to restrict its use to the current project). '
'This option is deprecated and would be removed in R'
' release.'))
shared_group.add_argument(
'--share',
action='store_true',
@@ -375,7 +354,7 @@ class UnsetFirewallGroup(command.Command):
attrs['ingress_firewall_policy_id'] = None
if parsed_args.egress_firewall_policy:
attrs['egress_firewall_policy_id'] = None
if parsed_args.share or parsed_args.public:
if parsed_args.share:
attrs['shared'] = False
if parsed_args.enable:
attrs['admin_state_up'] = False

View File

@@ -80,9 +80,9 @@ def _get_common_attrs(client_manager, parsed_args, is_create=True):
attrs['name'] = str(parsed_args.name)
if parsed_args.description:
attrs['description'] = str(parsed_args.description)
if parsed_args.share or parsed_args.public:
if parsed_args.share:
attrs['shared'] = True
if parsed_args.no_share or parsed_args.private:
if parsed_args.no_share:
attrs['shared'] = False
return attrs
@@ -107,19 +107,6 @@ def _get_common_parser(parser):
help=_('Share the firewall policy to be used in all projects '
'(by default, it is restricted to be used by the '
'current project).'))
shared_group.add_argument(
'--public',
action='store_true',
help=_('Make the firewall policy public, which allows it to be '
'used in all projects (as opposed to the default, which '
'is to restrict its use to the current project.) This '
'option is deprecated and would be removed in R release.'))
shared_group.add_argument(
'--private',
action='store_true',
help=_(
'Restrict use of the firewall policy to the current project.'
'This option is deprecated and would be removed in R release.'))
shared_group.add_argument(
'--no-share',
action='store_true',
@@ -403,12 +390,6 @@ class UnsetFirewallPolicy(command.Command):
action='store_true',
help=_('Restrict use of the firewall policy to the '
'current project'))
parser.add_argument(
'--public',
action='store_true',
help=_('Restrict use of the firewall policy to the '
'current project. This option is deprecated '
'and would be removed in R release.'))
return parser
def _get_attrs(self, client_manager, parsed_args):
@@ -428,7 +409,7 @@ class UnsetFirewallPolicy(command.Command):
attrs[const.FWRS] = []
if parsed_args.audited:
attrs['audited'] = False
if parsed_args.share or parsed_args.public:
if parsed_args.share:
attrs['shared'] = False
return attrs

View File

@@ -117,19 +117,6 @@ def _get_common_parser(parser):
action='store_true',
help=_('Detach destination port number or range'))
shared_group = parser.add_mutually_exclusive_group()
shared_group.add_argument(
'--public',
action='store_true',
help=_('Make the firewall policy public, which allows it to be '
'used in all projects (as opposed to the default, '
'which is to restrict its use to the current project). '
'This option is deprecated and would be removed in R Release'))
shared_group.add_argument(
'--private',
action='store_true',
help=_(
'Restrict use of the firewall rule to the current project.'
'This option is deprecated and would be removed in R release.'))
shared_group.add_argument(
'--share',
action='store_true',
@@ -212,9 +199,9 @@ def _get_common_attrs(client_manager, parsed_args, is_create=True):
attrs['enabled'] = True
if parsed_args.disable_rule:
attrs['enabled'] = False
if parsed_args.share or parsed_args.public:
if parsed_args.share:
attrs['shared'] = True
if parsed_args.no_share or parsed_args.private:
if parsed_args.no_share:
attrs['shared'] = False
if parsed_args.source_firewall_group:
attrs['source_firewall_group_id'] = client.find_resource(
@@ -416,12 +403,6 @@ class UnsetFirewallRule(command.Command):
'--share',
action='store_true',
help=_('Restrict use of the firewall rule to the current project'))
parser.add_argument(
'--public',
action='store_true',
help=_('Restrict use of the firewall rule to the current project. '
'This option is deprecated and would be removed in '
'R Release.'))
parser.add_argument(
'--enable-rule',
action='store_true',
@@ -448,7 +429,7 @@ class UnsetFirewallRule(command.Command):
attrs['destination_ip_address'] = None
if parsed_args.destination_port:
attrs['destination_port'] = None
if parsed_args.share or parsed_args.public:
if parsed_args.share:
attrs['shared'] = False
if parsed_args.enable_rule:
attrs['enabled'] = False

View File

@@ -118,7 +118,7 @@ class CreateNetworkLog(command.ShowOne):
help=_('Name for the network log'))
parser.add_argument(
'--event',
metavar='<event>',
metavar='{ALL,ACCEPT,DROP}',
choices=['ALL', 'ACCEPT', 'DROP'],
type=nc_utils.convert_to_uppercase,
help=_('An event to store with log'))

View File

@@ -222,7 +222,7 @@ class NeutronShell(app.App):
type=check_non_negative_int,
default=0,
help=_("How many times the request to the Neutron server should "
"be retried if it fails."))
"be retried if it fails. Defaults to 0."))
# FIXME(bklei): this method should come from keystoneauth1
self._append_global_identity_args(parser)
@@ -241,12 +241,12 @@ class NeutronShell(app.App):
parser.add_argument(
'--os-service-type', metavar='<os-service-type>',
default=env('OS_NETWORK_SERVICE_TYPE', default='network'),
help=_('Defaults to env[OS_NETWORK_SERVICE_TYPE] or network.'))
help=_('Defaults to env[OS_NETWORK_SERVICE_TYPE] or "network".'))
parser.add_argument(
'--os-endpoint-type', metavar='<os-endpoint-type>',
default=env('OS_ENDPOINT_TYPE', default='public'),
help=_('Defaults to env[OS_ENDPOINT_TYPE] or public.'))
help=_('Defaults to env[OS_ENDPOINT_TYPE] or "public".'))
# FIXME(bklei): --service-type is deprecated but kept in for
# backward compatibility.

View File

@@ -76,7 +76,5 @@ class ClientTestBase(base.ClientTestBase):
def is_extension_enabled(self, extension_alias):
extensions = self.parser.listing(self.neutron('ext-list'))
for extension in extensions:
if extension_alias in extension['alias']:
return True
return False
aliases = [e['alias'] for e in extensions]
return extension_alias in aliases

View File

@@ -1,2 +1,2 @@
enable_plugin neutron-fwaas https://git.openstack.org/openstack/neutron-fwaas
enable_plugin neutron-fwaas https://opendev.org/openstack/neutron-fwaas
enable_service q-fwaas

View File

@@ -1 +1 @@
enable_plugin neutron-vpnaas https://git.openstack.org/openstack/neutron-vpnaas
enable_plugin neutron-vpnaas https://opendev.org/openstack/neutron-vpnaas

View File

@@ -57,7 +57,7 @@ class FakeBgpSpeaker(object):
"""
bgp_speakers = []
for i in range(0, count):
for i in range(count):
bgp_speaker = FakeBgpSpeaker.create_one_bgp_speaker(attrs)
bgp_speakers.append(bgp_speaker)
@@ -89,8 +89,42 @@ class FakeBgpPeer(object):
def create_bgp_peers(attrs=None, count=1):
"""Create one or multiple fake bgp peers."""
bgp_peers = []
for i in range(0, count):
for i in range(count):
bgp_peer = FakeBgpPeer.create_one_bgp_peer(attrs)
bgp_peers.append(bgp_peer)
return {'bgp_peers': bgp_peers}
class FakeDRAgent(object):
"""Fake one or more dynamic routing agents."""
@staticmethod
def create_one_dragent(attrs=None):
attrs = attrs or {}
# Set default attributes.
dragent_attrs = {
'binary': 'neutron-bgp-dragent',
'admin_state_up': True,
'alive': True,
'topic': 'bgp_dragent',
'host': 'network-' + uuid.uuid4().hex,
'name': 'bgp-dragent-' + uuid.uuid4().hex,
'agent_type': 'BGP dynamic routing agent',
'id': uuid.uuid4().hex,
}
# Overwrite default attributes.
dragent_attrs.update(attrs)
return copy.deepcopy(dragent_attrs)
@staticmethod
def create_dragents(attrs=None, count=1):
"""Create one or multiple fake dynamic routing agents."""
agents = []
for i in range(count):
agent = FakeDRAgent.create_one_dragent(attrs)
agents.append(agent)
return {'agents': agents}

View File

@@ -0,0 +1,123 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from neutronclient.osc.v2.dynamic_routing import bgp_dragent
from neutronclient.tests.unit.osc.v2.dynamic_routing import fakes
class TestAddBgpSpeakerToDRAgent(fakes.TestNeutronDynamicRoutingOSCV2):
_bgp_speaker = fakes.FakeBgpSpeaker.create_one_bgp_speaker()
_bgp_dragent = fakes.FakeDRAgent.create_one_dragent()
_bgp_speaker_id = _bgp_speaker['id']
_bgp_dragent_id = _bgp_dragent['id']
def setUp(self):
super(TestAddBgpSpeakerToDRAgent, self).setUp()
# Get the command object to test
self.cmd = bgp_dragent.AddBgpSpeakerToDRAgent(self.app, self.namespace)
def test_add_bgp_speaker_to_dragent(self):
arglist = [
self._bgp_dragent_id,
self._bgp_speaker_id,
]
verifylist = [
('dragent_id', self._bgp_dragent_id),
('bgp_speaker', self._bgp_speaker_id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
with mock.patch.object(self.neutronclient,
"add_bgp_speaker_to_dragent",
return_value=None):
result = self.cmd.take_action(parsed_args)
self.neutronclient.add_bgp_speaker_to_dragent.\
assert_called_once_with(
self._bgp_dragent_id,
{'bgp_speaker_id': self._bgp_speaker_id})
self.assertIsNone(result)
class TestRemoveBgpSpeakerFromDRAgent(fakes.TestNeutronDynamicRoutingOSCV2):
_bgp_speaker = fakes.FakeBgpSpeaker.create_one_bgp_speaker()
_bgp_dragent = fakes.FakeDRAgent.create_one_dragent()
_bgp_speaker_id = _bgp_speaker['id']
_bgp_dragent_id = _bgp_dragent['id']
def setUp(self):
super(TestRemoveBgpSpeakerFromDRAgent, self).setUp()
# Get the command object to test
self.cmd = bgp_dragent.RemoveBgpSpeakerFromDRAgent(
self.app, self.namespace)
def test_remove_bgp_speaker_from_dragent(self):
arglist = [
self._bgp_dragent_id,
self._bgp_speaker_id,
]
verifylist = [
('dragent_id', self._bgp_dragent_id),
('bgp_speaker', self._bgp_speaker_id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
with mock.patch.object(self.neutronclient,
"remove_bgp_speaker_from_dragent",
return_value=None):
result = self.cmd.take_action(parsed_args)
self.neutronclient.remove_bgp_speaker_from_dragent.\
assert_called_once_with(self._bgp_dragent_id,
self._bgp_speaker_id)
self.assertIsNone(result)
class TestListDRAgentsHostingBgpSpeaker(fakes.TestNeutronDynamicRoutingOSCV2):
_bgp_speaker = fakes.FakeBgpSpeaker.create_one_bgp_speaker()
_bgp_speaker_id = _bgp_speaker['id']
attrs = {'bgp_speaker_id': _bgp_speaker_id}
_bgp_dragents = fakes.FakeDRAgent.create_dragents(attrs)
columns = ('ID', 'Host', 'State', 'Alive')
data = [(_bgp_dragent['id'],
_bgp_dragent['host'],
_bgp_dragent['admin_state_up'],
':-)' if _bgp_dragent['alive'] else 'XXX')
for _bgp_dragent in _bgp_dragents['agents']]
def setUp(self):
super(TestListDRAgentsHostingBgpSpeaker, self).setUp()
# Get the command object to test
self.cmd = bgp_dragent.ListDRAgent(self.app, self.namespace)
def test_list_dragents_hosting_bgp_speaker(self):
arglist = [
'--bgp-speaker', self._bgp_speaker_id,
]
verifylist = [
('bgp_speaker', self._bgp_speaker_id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
with mock.patch.object(self.neutronclient,
"list_dragents_hosting_bgp_speaker",
return_value=self._bgp_dragents):
columns, data = self.cmd.take_action(parsed_args)
attrs = {'bgp_speaker': self._bgp_speaker_id}
self.neutronclient.list_dragents_hosting_bgp_speaker.\
assert_called_once_with(**attrs)
self.assertEqual(self.columns, columns)
self.assertListEqual(self.data, list(data))

View File

@@ -120,20 +120,6 @@ class TestSetFWaaS(test_fakes.TestNeutronClientOSCV2):
target, {self.res: {'shared': True}})
self.assertIsNone(result)
def test_set_public(self):
target = self.resource['id']
arglist = [target, '--public']
verifylist = [
(self.res, target),
('public', True),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
result = self.cmd.take_action(parsed_args)
self.mocked.assert_called_once_with(
target, {self.res: {'shared': True}})
self.assertIsNone(result)
def test_set_duplicate_shared(self):
target = self.resource['id']
arglist = [target, '--share', '--share']

View File

@@ -139,8 +139,8 @@ class TestCreateNetworkLog(TestNetworkLog):
self.mocked = self.neutronclient.create_network_log
self.cmd = network_log.CreateNetworkLog(self.app, self.namespace)
loggables = {
"loggable_resources": [{"type": RES_TYPE_SG,
"type": RES_TYPE_FWG}]
"loggable_resources": [{"type": RES_TYPE_SG},
{"type": RES_TYPE_FWG}]
}
self.neutronclient.list_network_loggable_resources = mock.Mock(
return_value=loggables)

View File

@@ -33,9 +33,9 @@ class CLITestV20QoSRuleJSON(test_cli20.CLITestV20Base):
# qos_rule_types.
resources = 'rule_types'
cmd_resources = 'qos_rule_types'
response_contents = [{'type': 'bandwidth_limit',
'type': 'dscp_marking',
'type': 'minimum_bandwidth'}]
response_contents = [{'type': 'bandwidth_limit'},
{'type': 'dscp_marking'},
{'type': 'minimum_bandwidth'}]
cmd = qos_rule.ListQoSRuleTypes(test_cli20.MyApp(sys.stdout),
None)

View File

@@ -12,7 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import fixtures
import sys
import mock
from oslo_utils import encodeutils
import six
import testtools
@@ -30,12 +32,11 @@ class TestExceptions(testtools.TestCase):
multibyte_unicode_string = u'\uff21\uff22\uff23'
e = TestException(reason=multibyte_unicode_string)
fixture = fixtures.StringStream('stdout')
self.useFixture(fixture)
with fixtures.MonkeyPatch('sys.stdout', fixture.stream):
with mock.patch.object(sys, 'stdout') as mock_stdout:
print(e)
self.assertEqual('Exception with %s' % multibyte_unicode_string,
fixture.getDetails().get('stdout').as_text())
exc_str = 'Exception with %s' % multibyte_unicode_string
mock_stdout.assert_has_calls([mock.call.write(exc_str)])
def test_exception_message_with_encoded_unicode(self):
class TestException(exceptions.NeutronException):

View File

@@ -492,6 +492,9 @@ class Client(ClientBase):
network_path = "/networks/%s"
ports_path = "/ports"
port_path = "/ports/%s"
port_bindings_path = "/ports/%s/bindings"
port_binding_path = "/ports/%s/bindings/%s"
port_binding_path_activate = "/ports/%s/bindings/%s/activate"
subnets_path = "/subnets"
subnet_path = "/subnets/%s"
onboard_network_subnets_path = "/subnetpools/%s/onboard_network_subnets"
@@ -811,6 +814,28 @@ class Client(ClientBase):
"""Deletes the specified port."""
return self.delete(self.port_path % (port))
def create_port_binding(self, port_id, body=None):
"""Creates a new port binding."""
return self.post(self.port_bindings_path % port_id, body=body)
def delete_port_binding(self, port_id, host_id):
"""Deletes the specified port binding."""
return self.delete(self.port_binding_path % (port_id, host_id))
def show_port_binding(self, port_id, host_id, **_params):
"""Fetches information for a certain port binding."""
return self.get(self.port_binding_path % (port_id, host_id),
params=_params)
def list_port_bindings(self, port_id, retrieve_all=True, **_params):
"""Fetches a list of all bindings for a certain port."""
return self.list('port_bindings', self.port_bindings_path % port_id,
retrieve_all, **_params)
def activate_port_binding(self, port_id, host_id):
"""Activates a port binding."""
return self.put(self.port_binding_path_activate % (port_id, host_id))
def list_networks(self, retrieve_all=True, **_params):
"""Fetches a list of all networks for a project."""
# Pass filters in "params" argument to do_request
@@ -934,6 +959,16 @@ class Client(ClientBase):
return self.put((self.router_path % router) +
"/remove_router_interface", body=body)
def add_extra_routes_to_router(self, router, body=None):
"""Adds extra routes to the specified router."""
return self.put((self.router_path % router) + "/add_extraroutes",
body=body)
def remove_extra_routes_from_router(self, router, body=None):
"""Removes extra routes from the specified router."""
return self.put((self.router_path % router) + "/remove_extraroutes",
body=body)
def add_gateway_router(self, router, body=None):
"""Adds an external network gateway to the specified router."""
return self.put((self.router_path % router),

View File

@@ -0,0 +1,15 @@
- hosts: primary
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@@ -0,0 +1,52 @@
- hosts: all
name: Autoconverted job legacy-grenade-dsvm-neutron-libs from old job gate-grenade-dsvm-neutron-libs-ubuntu-xenial-nv
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
cat > clonemap.yaml << EOF
clonemap:
- name: openstack/devstack-gate
dest: devstack-gate
EOF
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
https://opendev.org \
openstack/devstack-gate
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
export PROJECTS="openstack/grenade $PROJECTS"
export DEVSTACK_PROJECT_FROM_GIT="os-client-config"
export DEVSTACK_PROJECT_FROM_GIT+=",keystoneauth"
export DEVSTACK_PROJECT_FROM_GIT+=",python-novaclient"
export DEVSTACK_PROJECT_FROM_GIT+=",python-keystoneclient"
export DEVSTACK_PROJECT_FROM_GIT+=",python-glanceclient"
export DEVSTACK_PROJECT_FROM_GIT+=",python-cinderclient"
export DEVSTACK_PROJECT_FROM_GIT+=",python-neutronclient"
export DEVSTACK_PROJECT_FROM_GIT+=",python-ironicclient"
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=1
export DEVSTACK_GATE_GRENADE=pullup
export DEVSTACK_GATE_USE_PYTHON3=True
export DEVSTACK_GATE_NEUTRON=1
export BRANCH_OVERRIDE=default
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@@ -0,0 +1,10 @@
---
deprecations:
- |
The ``openstack bgp speaker show dragents`` CLI is deprecated and
will be removed in the future. Use ``openstack bgp dragent list
--bgp-speaker <bgp-speaker>`` CLI instead.
features:
- |
The ``openstack bgp dragent list`` CLI is added to support showing
the list of dynamic routing agents.

View File

@@ -0,0 +1,5 @@
---
upgrade:
- |
Python 2.7 support has been dropped. The minimum version of Python now
supported by python-neutronclient is Python 3.6.

View File

@@ -0,0 +1,5 @@
---
features:
- |
New client methods: ``add_extra_routes_to_router`` and
``remove_extra_routes_from_router``.

View File

@@ -0,0 +1,5 @@
---
features:
- |
New client methods: ``create_port_binding``, ``delete_port_binding``,
``show_port_binding``, ``list_port_bindings`` and ``activate_port_binding``.

View File

@@ -2,7 +2,7 @@
features:
- Support os-client-config. OS_CLOUD environment variable is used for
selecting named cloud configuration.
- Support keystoneauth1 library which brings us better kyestone v3 support.
- Support keystoneauth1 library which brings us better keystone v3 support.
- Client command extension now supports a child resource.
- New CLI for VPNaaS multiple local subnets.
- New CLI for VPNaaS endpoint group API.

View File

@@ -0,0 +1,6 @@
---
upgrade:
- |
The deprecated options ``--public`` and ``--private`` were
dropped in FWaaS v2 related commands. Use ``--share`` and
``--no-share`` instead.

View File

@@ -46,7 +46,6 @@ extensions = [
repository_name = 'openstack/python-neutronclient'
bug_project = 'python-neutronclient'
bug_tag = 'doc'
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

View File

@@ -6,6 +6,8 @@
:maxdepth: 1
unreleased
train
stein
rocky
queens
pike

View File

@@ -0,0 +1,6 @@
===================================
Stein Series Release Notes
===================================
.. release-notes::
:branch: stable/stein

View File

@@ -0,0 +1,6 @@
==========================
Train Series Release Notes
==========================
.. release-notes::
:branch: stable/train

View File

@@ -6,6 +6,7 @@ description-file =
author = OpenStack Networking Project
author-email = openstack-discuss@lists.openstack.org
home-page = https://docs.openstack.org/python-neutronclient/latest/
python-requires = >=3.6
classifier =
Environment :: OpenStack
Intended Audience :: Developers
@@ -14,20 +15,16 @@ classifier =
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
[files]
packages =
neutronclient
[global]
setup-hooks =
pbr.hooks.setup_hook
[entry_points]
console_scripts =
neutron = neutronclient.shell:main
@@ -72,6 +69,7 @@ openstack.neutronclient.v2 =
sfc_service_graph_show = neutronclient.osc.v2.sfc.sfc_service_graph:ShowSfcServiceGraph
bgp_dragent_add_speaker = neutronclient.osc.v2.dynamic_routing.bgp_dragent:AddBgpSpeakerToDRAgent
bgp_dragent_list = neutronclient.osc.v2.dynamic_routing.bgp_dragent:ListDRAgent
bgp_dragent_remove_speaker = neutronclient.osc.v2.dynamic_routing.bgp_dragent:RemoveBgpSpeakerFromDRAgent
bgp_peer_create = neutronclient.osc.v2.dynamic_routing.bgp_peer:CreateBgpPeer
bgp_peer_delete = neutronclient.osc.v2.dynamic_routing.bgp_peer:DeleteBgpPeer
@@ -457,9 +455,6 @@ neutron.cli.v2 =
vpn-ikepolicy-update = neutronclient.neutron.v2_0.vpn.ikepolicy:UpdateIKEPolicy
vpn-ikepolicy-delete = neutronclient.neutron.v2_0.vpn.ikepolicy:DeleteIKEPolicy
[wheel]
universal = 1
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg

View File

@@ -13,17 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup(
setup_requires=['pbr>=2.0.0'],
pbr=True)

View File

@@ -3,7 +3,7 @@
# process, which may cause wedges in the gate later.
hacking>=1.1.0 # Apache-2.0
bandit>=1.1.0,<1.6.0 # Apache-2.0
bandit!=1.6.0,>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
flake8-import-order==0.12 # LGPLv3

30
tox.ini
View File

@@ -1,10 +1,11 @@
[tox]
# py3 first to avoid .testrepository incompatibility
envlist = py35,py27,pypy,pep8
envlist = py37,pep8
minversion = 2.3.2
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
@@ -12,7 +13,7 @@ setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
usedevelop = True
install_command = pip install {opts} {packages}
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/stein}
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
# Delete bytecodes from normal directories before running tests.
@@ -25,28 +26,20 @@ commands = sh -c "find . -type d -name '.?*' -prune -o \
whitelist_externals = sh
[testenv:pep8]
basepython = python3
commands =
flake8
{[testenv:bandit]commands}
distribute = false
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:functional]
setenv =
OS_TEST_PATH = ./neutronclient/tests/functional/core
OS_NEUTRONCLIENT_EXEC_DIR = {envdir}/bin
[testenv:functional-adv-svcs]
setenv =
OS_TEST_PATH = ./neutronclient/tests/functional/adv-svcs
OS_TEST_PATH = ./neutronclient/tests/functional
OS_NEUTRONCLIENT_EXEC_DIR = {envdir}/bin
[testenv:cover]
basepython = python3
setenv =
{[testenv]setenv}
PYTHON=coverage run --source neutronclient --parallel-mode
@@ -58,12 +51,19 @@ commands =
coverage report
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
whitelist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@@ -76,13 +76,11 @@ import-order-style = pep8
enable-extensions=H904
[testenv:bandit]
basepython = python3
# B303: blacklist calls: md5, sha1
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r neutronclient -x tests -n5 -s B303
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt