483 Commits

Author SHA1 Message Date
Takashi Kajinami
2d93d2e1ed Bump hacking
hacking 3.0.x is too old.

This also pulls the hacking options from neutron.

Change-Id: Ic1a428a05131f98d5a9050b83613c5478904f202
2024-01-30 18:09:53 +09:00
Frode Nordahl
1df1f38a91 Add support for 'smart-nic' vnic-type
The 'smart-nic' vnic_type was added in the Train time frame in
I91f63810626ce4e054e358f5de5e46434c4da131.  This vnic_type will
also be used to support off-path SmartNIC port binding with OVN,
and it is expected that the user will create ports with this
vnic_type as part of the workflow.

As such the client must allow users to interact with this
vnic_type and this patch addresses that.

Partial-Bug: #1932154
Change-Id: I7f80bb47db7f8608db4d6a646b0f4b0ef6d6fb48
2021-09-14 14:31:24 +02:00
Jens Harbott
9ffa0ac14e Allow 4byte ASNs in dynamic routing client
Neutron-dynamic-routing has the bgp_4byte_asn extension which allows
4byte ASNs to be used, increasing the range of valid AS numbers. Since
we cannot easily tell beforehand whether that extension is available,
allow for the maximal interval to be used by clients and let the API
validate the input.

Change-Id: Ib4695272784b4a5ebbcb792cfec82dac3ef6f3cf
2020-09-01 13:51:11 +02:00
Hervé Beraud
42ebefab3b Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I65fb53db889afcf1a947ea61094bfab877853324
2020-06-02 20:50:34 +02:00
zhanghao
3cfa54fa56 Remove usage of six
With python3.x, classes can use 'metaclass=' instead of
'six.add_metaclass', 'six.iteritems' and 'six.iterkeys' can
be replaced by 'items' and 'keys', 'six.moves.urllib.parse'
can be replaced by 'urllib.parse', 'six.StringIO' and
'six.moves.cStringIO' can be replaced by 'io.StringIO',
'six.text_type' and 'six.string_type' are just 'str'.

Change-Id: I357968c6a1932856b1600f6c191966bc90cbc258
2020-05-15 17:27:56 -04:00
jacky06
9a91b4ad38 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I3cc418bd8219a3d4f3ab5c018adf06b66ef36b46
2019-04-28 14:25:39 +08:00
Akihiro Motoki
f99c63f98a Update hacking version to 1.1
Older hacking depends on pep8, but pep8 module is replaced by
pycodestyle. This can be resolved by updating hackinng version.

This commit also fixes E117 (over-indented) and
W605 (invalid escape sequence) warnings.

pep8 is dropped from lower-constraints.txt as it is no longer used.

Change-Id: I3a8e3b0dedf9422e4db02b525b333d12ce012a95
2019-01-31 10:45:24 +09:00
Lucian Petrut
3de4353dcd Fix api version handling, which completely breaks the client
The neutron client does not work with recent openstacksdk versions
(>=0.18.0): http://paste.openstack.org/raw/734040/

This change addresses a mismatch in the api version format.
The neutron client passes a dict while the openstack sdk expects a
string.

Change-Id: I33c868f1c1e40d7673ba6651abedf3dfe0850660
Closes-Bug: #1801360
2018-11-02 15:30:30 +02:00
Mykola Yakovliev
0aefe1ccba Ensure API calls for subnets are in URL length limit
Fix situation when with pagination enabled, neutronclient failed
to read subnets information due to too long URI.

Change-Id: I53240c536d77a95510b5c83b81e21782f29d886a
Closes-Bug: 1775922
2018-08-31 20:08:57 +00:00
Gleb Zimin
2cf52672b7 Replace insecure function eval
In neutronclient we use a eval function for processing
CLI neutron arguments. This function possible insecure because
eval get argument from client side. Instead of it we can use
a dict with allowed types which is more secure.

Closes-Bug: #1762938
Change-Id: Idde55d1b9206e9ef8742464825709f098d488a8e
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
2018-04-12 02:30:09 +00:00
Akihiro Motoki
19d0609888 Fix pep8 error
pycodestyle 2.4.0 which is updated along with pep8
introduces new checks and they hit neutronclient.

Change-Id: Ic417aee3239c46f1e989c50b9814adfd75cff175
2018-04-11 21:36:15 +09:00
Cao Xuan Hoang
f4c0468b36 Use flake8-import-order plugin
In reviews we usually check import grouping but it is boring.
By using flake8-import-order plugin, we can avoid this.
It enforces loose checking so it sounds good to use it.
This flake8 plugin is already used in tempest.

Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.

Setup for unit tests of hacking rules is tweaked to disable
flake8-import-order checks. This extension assumes an actual file
exists and causes hacking rule unit tests.

Change-Id: I61e683ab0119e4ae90b7107f0690528d789e3875
2017-07-06 16:47:49 +07:00
Akihiro Motoki
d6d42af64a CLI implementation should raise CommandError
NeutronClientException is an exception raised from API bindings
and it should not be used in CLI layer.

TrivialFix

Change-Id: I3df4c7352c96f10388df65bd16016b3ceb221248
2017-06-15 09:06:32 +09:00
M V P Nitesh
235c4e60aa Now empty tags are not added to Networks
Added a check if the tag values is empty or not before adding that tag
to the network.

Change-Id: I92659da97fe829a7715d0bef5570a4d9c5db95da
Closes-Bug: #1603292
2017-05-01 19:56:50 +00:00
Jenkins
ad804c89e7 Merge "Do not append .json to sending URL" 2017-04-21 02:54:42 +00:00
Jenkins
ce607ad718 Merge "Supports adding tags for port, router, subnet, subnetpool" 2017-04-19 03:14:42 +00:00
huangtianhua
fbef092b6f Supports adding tags for port, router, subnet, subnetpool
Neutron supports adding tags for several resources:
network, port, subnet, subnetpool, router,
but neutronclient only support to add tags for network,
support for others .

Change-Id: Iae8da2fa0e18e14ba27ce5232db8da5fe6eb0b86
Closes-Bug: #1676697
2017-04-19 00:28:38 +00:00
Jenkins
b828d2b134 Merge "Revert "HAProxy uses milliseconds for its timeout values."" 2017-04-18 16:00:58 +00:00
Akihiro Motoki
a905f755b9 Do not append .json to sending URL
Both SessionClient and HTTPClient set content-type as application/json,
so there is no need to append ".json" as a format specifier.

This commit also cleans up 'format' attribute in various client class
and unit tests.

Also hide --request-format opiton from the command line help as it is
just ignored. We need to keep the option to keep backward-compatibility.

Closes-Bug: #1678488
Change-Id: I5fc69b9dfed9b7b6350a4aad06417a914a80d090
2017-04-02 00:52:12 +09:00
Jenkins
9381cdfb97 Merge "Allow to specify tenant_id in subnetpool-create" 2017-03-31 03:03:15 +00:00
Akihiro Motoki
9baf4b892e Allow to specify tenant_id in subnetpool-create
Previously tenant_id option was ignored in subnetpool-create.
--tenant-id option is supported in all create commands in neutron CLI
and it is important to keep this consistency for good user experience.

Change-Id: Ifab51d623f8f3519523b284fc04e5b28301b5928
Closes-Bug: #1667279
2017-03-25 04:27:09 +09:00
Akihiro Motoki
5c7812f178 Fix label of allowed-address-pair ip_address
CLI reference is still generated from neutron CLI.
It looks better to fix the output of CLI.

Change-Id: Icf676730b53044fa0a14c4101eb52a792ea4cc4f
Closes-Bug: #1669974
2017-03-25 01:27:08 +09:00
Jenkins
465a89246f Merge "Fixed a bunch of spacing" 2017-03-05 22:22:31 +00:00
Ankur Gupta
3bf9d4c609 Change documentation about UpdateQuota class
The documentation about UpdateQuota is misleading.
This makes it seem like you can only update a quota when it is currently
the default quota values.

Trivial Fix

Change-Id: I5dae7b38d388f4abae5d927998e809839e8ef879
2017-03-02 04:15:03 +00:00
Jenkins
cf9d5e4025 Merge "Add rbac_policy to quota resources" 2016-12-23 15:15:54 +00:00
Jenkins
85f3f237fc Merge "Disallow specifying name for meter-label-rule" 2016-11-29 06:31:33 +00:00
Jenkins
ce7632eba2 Merge "Added --enable-snat option for router-gateway-set" 2016-11-25 10:36:03 +00:00
Rodion Tikunov
cc1d3fdd35 Added --enable-snat option for router-gateway-set
If enable_snat_by_default option set to false and disable snat via cli
it becomes unavailable to enable snat again.
This commit allows to enable snat after disabling it.

Change-Id: I01009d5cd5edd5be3eead615c37d6aa2e3224442
Closes-Bug: #1598171
2016-11-08 17:56:09 +03:00
Dongcan Ye
42d995bf9d [VPNaaS] Add support for sha2-384 and sha2-512
Commit I87b257ee6500c424fc273955a6d89d972a2823e9 had supported
sha2-384 and sha2-512 in VPNaaS side, this patch add those support
in CLI side.

Change-Id: Ie1842acd830e9b8c624cf099491ed5ff46304b8d
Closes-Bug: #1639990
2016-11-08 10:04:18 +08:00
Jenkins
3328367624 Merge "Show tenant_id in *-list by admin" 2016-10-20 21:23:40 +00:00
Kevin Benton
450c8670d9 Add rbac_policy to quota resources
Allow updating the quota for rbac policies.

Change-Id: Ia14efb844fa6dd4127840408a03cb54f16d78b35
Closes-Bug: #1631231
2016-10-13 14:50:26 -07:00
Reedip
d8df6002d7 Fix Quota Support for HMs
Health Monitors could not be updated using
the `neutron quota-update` CLI.

This patch fixes the same.

Change-Id: Ie9eefcd9042f3d09b3ba88a9bd195463302dd5c0
Closes-Bug: #1624225
2016-10-10 09:28:10 +00:00
Jenkins
33b8a0cf0b Merge "Replace lb_method with lb_algorithm" 2016-10-07 21:47:53 +00:00
Jenkins
53f4dced50 Merge "Use raw values when non-table formatter is used" 2016-10-03 16:58:26 +00:00
Reedip
9ecea3bbf1 Return proper error code for CLI failure
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
2016-10-03 10:32:39 +00:00
Jenkins
ec381102c2 Merge "Modify the help of connection-limit" 2016-09-22 00:15:24 +00:00
Jenkins
3c2925a4de Merge "Simplify clearing session-persistence" 2016-09-13 13:16:56 +00:00
Doug Wiegley
f801289d0d Revert "HAProxy uses milliseconds for its timeout values."
This reverts commit 6ba4f31fbf446a98af3d0cbfadf18e5cafc2236b.

Change-Id: I0fd80b126847ea9b2cebcb2578ea1bd3110b30d4
2016-09-12 23:36:18 +00:00
Jenkins
513d56b0c4 Merge "Correct DisassociatingHealthmonitor help messages" 2016-09-07 23:57:30 +00:00
Reedip
6bdac38263 Replace lb_method with lb_algorithm
LBaaS v2 Pools consist of lb_algorithm, but
ListPool still tries to show lb_method (which
was not a part of LBaaS v2 but LBaaS v1).

Change-Id: I0630fafc1c555c9110bee11def873dce8ecf4770
Closes-Bug: #1620639
2016-09-07 09:11:47 +00:00
Jenkins
f53d624198 Merge "Add QoS egress minimum bandwidth rule to neutronclient" 2016-09-01 17:01:13 +00:00
guiyanxing
75468cc02f Correct DisassociatingHealthmonitor help messages
Change-Id: Ie6f0419046f25c078f49c5343fbb4e10232a0b88
2016-09-01 10:50:17 +00:00
Kevin Benton
afe3c8389d Add flavor argument to router
This allows the router to take a flavor argument that can
be either the ID or the name of a flavor to use when creating
a router.

Partially-Implements: blueprint multi-l3-backends
Change-Id: I100fc75de6d41900f6452f356f0b7b741cd177ce
2016-08-28 10:44:17 -07:00
Jenkins
fdf7e770b6 Merge "quota-update to return an error msg for 0 args" 2016-08-31 01:10:03 +00:00
Anindita Das
98110501e0 quota-update to return an error msg for 0 args
If no arguments are provided while executing neutron quota-update
instead of printing the current quota values it will throw an error
message "Must specify new values to update quota"

Added unit test to verify that the exception is raised when no
arguments are provided to quota update

Includes release notes.

DocImpact

Closes-Bug: #1597552

Change-Id: I476991c39eafa16148f0cc3252ae5c26b9c8cbfc
2016-08-29 16:51:09 +00:00
Rodolfo Alonso Hernandez
a6cdd1dace Add QoS egress minimum bandwidth rule to neutronclient
The following patch implements the QoS egress minimum
bandwidth assurance in neutronclient.

Change-Id: I025522f73a9a8e3a9f69f097cedaeba330b9914a
Depends-On: I6b619a96a2bfde164646c71409b671352bc6ce7d
Depends-On: I13c54be22f35ac7eb5835d8424a919d0b61a8e95
Partial-Bug: #1560963
2016-08-28 10:59:06 +00:00
Jenkins
a33edfa08d Merge "Provide client bindings for DELETE method of auto-allocated-topology extension" 2016-08-27 10:48:57 +00:00
Armando Migliaccio
ee6b6eafb7 Provide client bindings for DELETE method of auto-allocated-topology extension
DocImpact: Add documentation for auto-allocate-topology-delete CLI

Partial-bug: #1614872

Depends-on: I2fba51bdf8c781fcc0449e1e9947de976c96eec4
Change-Id: I07ef85e4a0c43613351820bd56e429d0155c9fa5
2016-08-25 21:07:48 +00:00
reedip
c33b041c0c Remove case dependancy for user inputs
With the introduction of Lowercase/Uppercase conversion
functions in the utils.py, the following patch removes the
dependancy of the current code on character casing.

utils.convert_to_lowercase is called where the code expects
the input to be in lower case while utils.convert_to_uppercase
will be called where the code expects the input to be in
CAPITAL casing only.

Change-Id: I1c5c3c87f343fc2731469b9a0c38d278f6018a11
2016-08-25 03:49:36 +00:00
Jenkins
64e8c3e21a Merge "Fix prompt message for qos-bandwidth-limit-rule-create" 2016-08-24 23:29:45 +00:00