Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I12e1a2a4a22116cabd09a3b808f871d98e4bd1f2
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Fix situation when with pagination enabled, neutronclient failed
to read subnets information due to too long URI.
Change-Id: I53240c536d77a95510b5c83b81e21782f29d886a
Closes-Bug: 1775922
Due to [1] , the return code which was expected from
NeutronClient changed if a particular CLI failed to
find an object belonging to the resource to be deleted.
The following patch fixes it.
[1]: https://review.openstack.org/#/c/263609/
Change-Id: I19b4328361157fbca3e557e02797ed0c895e924b
Closes-Bug:#1623169
As mentioned by Akihiro Motoki in I3b8a05698625baad3906784e3ecffb0f0242d660
the variable name "extra_ids" needed a cleanup, which
is done in this patch.
TrivialFix
Change-Id: I9636582a3d76332916f9502c9906dc6570709c12
The following patch adds support for BulkDelete in NeutronClient.
Currently, the core existing Neutron CLIs are going to support
Bulk Deletion in NeutronClient. However, if any extension does not
require Bulk Delete, it can be disabled by updating the
class attribute 'bulk_delete'.
DocImpact
Depends-On: Ib23d1e53947b5dffcff8db0dde77cae0a0b31243
Change-Id: I3b8a05698625baad3906784e3ecffb0f0242d660
Closes-Bug: #1495440
This adds the description field to the parsers for all
of the resources that gained description fields in the
dependent patch.
Change-Id: I939b517c5320ea9dd3f387c12adee1ed8876adec
Related-Bug: #1483480
Depends-On: I6e1ef53d7aae7d04a5485810cc1db0a8eb125953
DNS integration has been added to Neutron. This commit complements that
by adding --dns-name and --dns-domain arguments to create and update
commands of networks, ports and floating IPs.
Change-Id: I7a6ec05b6d7483fceb35f586ac476e8713904b59
Closes-Bug: #1547736
This implements a common framework for attribute filtering arguments
and arguments for net-list as an initial support.
Co-Authored-By: Reedip Banerjee <reedip.banerjee@nectechnologies.in>
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ie1b896d6f293b2881a7067ed9232a5957a5180cb
Closes-Bug: #1320798
Partial-Bug: #1488912
If API call is done by admin, neutron API returns all resources
from all tenants. We received several times a request that
tenant_id is useful in such case.
This patch displays tenant_id column when *-list is invoked
by a user with 'admin' role by default. If columns to be displayed
are specified by '-c' option, the specified columns are honored
and tenant_id columns is not added.
Add functional tests to cover this change. This feature depends
on keystoneauth1 and unit tests cannot cover this change.
Closes-Bug: #1526238
Change-Id: Id58a0b795f76b4fe24aaf89f1f6486c23f19a553
Previously the dropped OpenStackCommand uses get_data()
as an interface which subclasses should implement.
On the other hand, cliff Command recommends to implement
take_action() in subclasses and there is no reason not to
follow this convention.
Partial-Bug: #1532258
Change-Id: I164d6f31152df621611985a84eef76e7dfa54d44
There are a lot of H405 violation codes.
We need to fix the code for avoiding more violations.
Change-Id: Iaa83626b81a3d8369b16e2b4f394e2bc4628998a
Closes-Bug: #1521899
As XML support has been removed from neutron, there is no need
to keep it in client.
Dropped XML serializer and deserializer and deprecated "request-format"
CLI option, making JSON the default and the only supported request
format.
DocImpact
Change-Id: I88b0fdd65a649694252d5ff43a174e75026df5b1
Closes-Bug: #1380787
This patch adds the availability_zone support for CLI.
Change-Id: I13faf6d90e84f401f07376c517c643ba9eda2295
Co-Authored-By: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Partially-implements: blueprint add-availability-zone
assertEqual expects that the arguments provided to it should be
(expected, observed).If a particluar order is kept as a convention,
then it helps to provide a cleaner message to the developer if Unit Tests
fail. There are several Unit Test files where the arguments for assertEqual
have been swapped. This commit fixes the issue in python-neutronclient.
Additionally instead of using assertEqual(True,xxx), assertTrue(xxx) should
be used. The same has been fixed in this patch.
Partial-Bug: #1259292
Related-Bug: #1259292
Change-Id: I83ec45af75f61f8005a60efc8176db0df5cfbe9a
This patch adds the command line support for
1. QoS policy
2. QoS policy association with the neutron network
3. QoS policy association with the neutron port
Note: Neutronclient support for QoS rule-types will be addressed via a separate patch
(https://review.openstack.org/#/c/198277/)
DocImpact
APIImpact
Partially-Implements: blueprint quantum-qos-api
Co-Authored-By: Ramanjaneya Reddy Palleti <ramanjieee@gmail.com>
Co-Authored-By: John Schwarz <jschwarz@redhat.com>
Co-Authored-By: vikram.choudhary <vikram.choudhary@huawei.com>
Change-Id: If7460516a3b3e3ccb91f2e7becfe7335ff809bda
This reverts commit 096fd1b175085fcc3c46a248b4afb67561fd29ef.
In previous neutronclient versions, we allowed the following syntax to
set network as external: --router:external=False or --router:external=True.
Since Ibb100d54a5fd8b04ac5e1fc3a26826c695f4d951 was merged, this syntax
no longer works.
Conflicts:
neutronclient/neutron/v2_0/network.py
Change-Id: Idbae5461dcaeff3da48d773e323977afcdc6f85e
Closes-Bug: #1451391
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.
The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.
Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.
Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages
Change-Id: I474dcd9de166b00d02b3586858a28797e97a3231
Adding VLAN Transparency support to neutronclient, it allows
to create new vlan transparent networks. It adds support for
displaying the network vlan transparency support via net-list.
DocImpact
Depends-on: Ie87087a70b83dab589419aa5c17ce7ccafd64cbd
Implements: blueprint nfv-vlan-trunks
Change-Id: I24c2eecd34123933f98b596654baaf76ed1453e8
This bug is caused because of the regression caused by
I1b719bed406b83c5f2deac06e127798a91f51ad7 . The original bug was
raised because check_max_uri was not working after the introduction
of sessionclient. The change created a regression in which the
python bindings of the neutron client was not usable and causing
traces.
The fix is to revert the change id and add a new check_max_uri to
the sessionclient. Now uri length will be checked in sessionclient
and httpclient as well. please see bug for further info.
Closes-Bug: #1431449
Change-Id: Ief2352a90bb75a76e8c671d51beb0fb7a53a22f9
A previous commit 799e288f48e5d99731dedbfb94808a8cbe01c05c
has broken the ability to recognise long URIs (>8192) and
raise an exception used to prevent the excessive URI being sent
to the server. This impacts the commands net-list and
security-group-rule-list.
The previous edit removed one of the duplicate _check_uri_length functions.
This edit 'swaps' the removal and updates the unit test stubbing accordingly.
The capability to split excessive URIs into managable chunks remained in
the code, but no longer executed because this exception was not raised.
It should be noted that as a side effect of recognising the
long URI, data is returned with the exception that indicates
'how excessive' the URI length was. This allows the URI to be
broken into chunks that will be supported.
Restore the capability to recognise that an excessive URI has
been provided and to raise the expected exception with
related data.
Closes-Bug: #1422736
Change-Id: I1b719bed406b83c5f2deac06e127798a91f51ad7
Currently when provider network attributes are placed before the network
name in neutron net-create command, the network name is incorrectly parsed
to one of the provider attribute values. This patch addresses the issue by
parsing the provider network attributes, which inturn allows us to place
these attributes at any location in the argument list.
Closes-Bug: #1384984
Change-Id: I930ced12d1f6747df91a47af8f34585ed36b84f3
The adapter in keystoneclient is there to abstract the common client
parameters that may be used when sending a request. We should use that
rather than keeping our own methods.
Closes-Bug: #1403726
Change-Id: I727ac76babb6f6aef1a0f619c011ad67a6e2fccf
The following libraries have been graduated:
- gettextutils -> oslo.i18n
- jsonutils -> oslo.serialization
- strutils, timeutils -> oslo.utils
Add neutronclient.i18n module as oslo.i18n adapter.
Remove openstack.common related files completely
because neutronclient no longer use any oslo-incubator modules.
Closes-Bug: #1382017
Change-Id: Ib7ebcb691a12858049baab3b122f95bf43038f18
* Replace of urllib by six urlparse
* Convert dict keys into list to be able to retrieve the first element
* Use integer division for integers
* Use int instead of long in XML serialization/deserialization under Py3
Co-author: Cyril Roelandt <cyril.roelandt@enovance.com>
Change-Id: Ia79c831310775bf1c3dbec06010f8949c3a73887
This patch removes our own home brewed json helper functions and leverages
the ones from openstack.common.jsonutils instead.
Change-Id: Idc5ee0fec56b0a0f337433a830647d4f421a8283
Closes-bug: 1365263
Modifying passed arguments inadvertently is an easy pitfall in python.
Even more serious is modifying the default value to a function, since
that modification will be preserved across future function calls.
The typical defense against the latter is to avoid using mutable default
values.
This change replaces several def foo(bar=[]) with bar=() or similar, and
then fixes a few cases that were exposed where the argument was indeed
permanently modified.
Change-Id: I3d04dcb39e3816942f8e80ce499c47d774a773c6
Many tests rely on order of parameters in URL query, but
queries are constructed from dicts and order of parameters
is non-deterministic. The issue doesn't occur if PYTHONHASHSEED
stays constant, but breaks if random. The fix is needed for
tox>1.7 and Py3.
Closes-Bug: 1348818
Change-Id: I01145df689e90ccd6100fa82092ba3ed222af8fc
mox3 is a Python 3.x compatible drop-in and allows
to continue with the porting effort to Python 3.x with
minimal code changes.
Closes-Bug: #1283482
Change-Id: Ib052f1b87e312481e4c7c8d775ece94f53e7106b
We don't need to have the vi modelines in each source file,
it can be set in a user's vimrc if required.
Change-Id: Ic30e91df1b0e25beda9b8d8c19be58573cdae4f6
Closes-Bug: #1229324
Remove the useless arg ("start index" = 0) in files, since its default
value is 0, to make code cleaner.
Fixes bug #1261580
Change-Id: Ieeace91e8cbd540ddccd8288002331a6e5a70c58
Neutron itself has all of its tests in neutron/tests, as do 2/3 of
the projects in OpenStack. There are a wealth of reasons to put
them in the package, not the least of which that tests/__init__.py
implies a code living in a global namespace called tests.
Change-Id: I2aaacfe59d6790648aa4587e89e6dd28a9149a6c