Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a09e82470f | ||
|
|
33ae5ad4e1 | ||
| e4bad046de | |||
| 4d50713d54 | |||
|
|
115f60f005 | ||
|
|
1c634ed2c1 | ||
|
|
e35b3c160b | ||
|
|
62f4868e6e | ||
|
|
ab426a791a | ||
|
|
1a8fdf355d | ||
|
|
6330cc1980 | ||
|
|
6ea4cb57dd | ||
|
|
2af19d55d6 | ||
|
|
34924865b3 | ||
|
|
cf95be3ea5 | ||
|
|
d40f4cc96b | ||
|
|
e2ee92e2e1 | ||
|
|
dc10f44128 | ||
|
|
209e1801ac | ||
|
|
88c660dbe8 | ||
|
|
9a91b4ad38 | ||
|
|
b62a1cd1a4 | ||
|
|
da62ba3029 | ||
|
|
f0c886cbe7 | ||
|
|
d572f2cdd2 | ||
|
|
4cbf6ddc66 | ||
| ca875adf38 | |||
|
|
b4a0e27ec6 |
@@ -2,4 +2,4 @@
|
||||
host=review.opendev.org
|
||||
port=29418
|
||||
project=openstack/python-neutronclient.git
|
||||
defaultbranch=stable/stein
|
||||
defaultbranch=stable/train
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[DEFAULT]
|
||||
test_path=./neutronclient/tests/unit
|
||||
test_path=${OS_TEST_PATH:-./neutronclient/tests/unit}
|
||||
top_dir=./
|
||||
|
||||
39
.zuul.yaml
39
.zuul.yaml
@@ -3,8 +3,7 @@
|
||||
- openstack-cover-jobs
|
||||
- openstack-lower-constraints-jobs
|
||||
- openstack-python-jobs
|
||||
- openstack-python35-jobs
|
||||
- openstack-python36-jobs
|
||||
- openstack-python3-train-jobs
|
||||
- publish-openstack-docs-pti
|
||||
- check-requirements
|
||||
- lib-forward-testing
|
||||
@@ -13,20 +12,10 @@
|
||||
- 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:
|
||||
@@ -34,3 +23,25 @@
|
||||
- ^(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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
openstackdocstheme>=1.18.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;python_version>='3.4' # BSD
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1 +1 @@
|
||||
enable_plugin neutron-vpnaas https://git.openstack.org/openstack/neutron-vpnaas
|
||||
enable_plugin neutron-vpnaas https://opendev.org/openstack/neutron-vpnaas
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -934,6 +934,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),
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
New client methods: ``add_extra_routes_to_router`` and
|
||||
``remove_extra_routes_from_router``.
|
||||
@@ -6,6 +6,7 @@
|
||||
:maxdepth: 1
|
||||
|
||||
unreleased
|
||||
stein
|
||||
rocky
|
||||
queens
|
||||
pike
|
||||
|
||||
6
releasenotes/source/stein.rst
Normal file
6
releasenotes/source/stein.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
===================================
|
||||
Stein Series Release Notes
|
||||
===================================
|
||||
|
||||
.. release-notes::
|
||||
:branch: stable/stein
|
||||
@@ -17,8 +17,8 @@ classifier =
|
||||
Programming Language :: Python :: 2
|
||||
Programming Language :: Python :: 2.7
|
||||
Programming Language :: Python :: 3
|
||||
Programming Language :: Python :: 3.5
|
||||
Programming Language :: Python :: 3.6
|
||||
Programming Language :: Python :: 3.7
|
||||
|
||||
[files]
|
||||
packages =
|
||||
|
||||
@@ -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
|
||||
|
||||
12
tox.ini
12
tox.ini
@@ -1,6 +1,6 @@
|
||||
[tox]
|
||||
# py3 first to avoid .testrepository incompatibility
|
||||
envlist = py35,py27,pypy,pep8
|
||||
envlist = py37,py27,pypy,pep8
|
||||
minversion = 2.3.2
|
||||
skipsdist = True
|
||||
|
||||
@@ -12,7 +12,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://releases.openstack.org/constraints/upper/train}
|
||||
-r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
# Delete bytecodes from normal directories before running tests.
|
||||
@@ -36,13 +36,9 @@ basepython = python3
|
||||
commands = {posargs}
|
||||
|
||||
[testenv:functional]
|
||||
basepython = python3
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user