Commit graph

979 commits

Author SHA1 Message Date
Jay Faulkner
a09e82470f 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
(cherry picked from commit 946ac3ed2e)
2020-02-03 14:44:51 +00:00
Akihiro Motoki
33ae5ad4e1 Fix pep8 errors with hacking 2.0.0
Change-Id: I4737d4bc4fa116f45e2361eba93f48feae0161a4
(cherry picked from commit 91fb009706)
2020-01-29 16:34:58 +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
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
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
jacky06
9a91b4ad38 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I3cc418bd8219a3d4f3ab5c018adf06b66ef36b46
2019-04-28 14:25:39 +08: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
Ryan Tidwell
680b417111
Add subnet onboard CLI
This is the implementation of the "onboard network subnets" CLI.
This enables the subnet onboard feature of neutron to be driven via
CLI.

Depends-On: https://review.openstack.org/348080
Change-Id: Ic637ed689b0d3806d2c33faa419c3a98a310effa
Implements: blueprint subnet-onboard
2019-02-27 08:39:40 -06:00
cao.yuan
1f35b8f25c Update json module to jsonutils
oslo project provide jsonutils, and neutronclient use it in many place[1],
this PS to update the remained json module to oslo jsonutils for
consistency.

[1]: https://github.com/openstack/python-neutronclient/search?utf8=%E2%9C%93&q=jsonutils&type=

Change-Id: Ic4639628c8910b88a14b0fe8f37638bb4f9474be
2019-02-25 09:28:34 +00: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
mid_one
9cbdfb2181 Add support for querying quotas with usage
The neutron HTTP API supports issuing a GET call
on /v2.0/quotas/{project_id}/details.json in order
to obtain quotas with usage information for a
given tenant. However, this capability is not
currently exposed in the python-neutronclient code.

Add path: quota_details_path
Add function show_quota_details

Closes-Bug: #1808451
Related-Bug: #1599488
Change-Id: Ia02172f62b9d9915273021627b0feb52a4f376da
2018-12-14 19:18:40 +08:00
Zuul
a8720c3c4d Merge "Support of the boolean advertise_extra_routes" 2018-11-20 19:34:23 +00:00
Samuel Barré
b60283cd16 Support of the boolean advertise_extra_routes
This Boolean attribute is added to the Router Association resource
(Neutron API, 'bgpvpn' and 'bgpvpn-routes-control' API extensions) in
order to support routes control. This allow to propagate routes of
subnets not directly connected to the router
The corresponding code in networking-bgpvpn has already merged

See https://blueprints.launchpad.net/bgpvpn/+spec/routes-control

Change-Id: Icdd7f6592a9d657b6414645406f06b74b6f3bb11
Implements: blueprint routes-control
2018-11-20 14:59:08 +00:00
Zuul
d8cb1472c8 Merge "Fix docstring in method list_routers_on_l3_agent" 2018-11-13 00:22:46 +00:00
mid_one
1d45522a48 Fix docstring in method list_routers_on_l3_agent
For function list_routers_on_l3_agent in the
python-neutronclient\neutronclient\v2_0\client.py,
the description is "Fetches a list of L3 agents
hosting a router". However this function fetches
a list of routers hosted on a L3 agent.

Change the docstring.

Change-Id: Ia2156b5f6f016f338549a6536a0f31bf9e96c7cf
Closes-Bug: 1802475
2018-11-12 21:07:35 +00:00
mid_one
cb1e24b178 Fix docstring in method list_networks_on_dhcp_agent
For function list_networks_on_dhcp_agent in the
python-neutronclient\neutronclient\v2_0\client.py,
the description is "Fetches a list of dhcp agents
hosting a network". However this function fetches
a list of networks hosted on a DHCP agent.

Change the docstring.

Change-Id: Ifa833d9a7ecab8ba55283d41d7a336d20cb578c3
Closes-Bug: 1802472
2018-11-12 23:45:01 +08: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
German Eichberger
a385656802 Adds the destination and source fwg to fwr
This will add the source and destination firewall group id to
firewall rules.

Change-Id: If69b87fc58d36aa7d879ace8e73bc0f7534a1ef4
2018-09-10 11:54:29 -06:00
Vu Cong Tuan
259c386d42
Switch to stestr
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: Ib58745d5c0d98fb79eb3cf7278c2cbfb5160efcd
2018-09-06 01:09:28 +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
Kim Bao Long
80f916489b [log] Add 'firewall_group' as a loggable resource type for logging
Currently, OSC plugin for logging only supports security group as
a loggable resource. This patch aims to add 'firewall_group' as a
supported resource type.

Co-Authored-By: Van Hung Pham <HungPV@vn.fujitsu.com>
Depends-On: Ie10063197f02679e987e87cb4852f5230a02f76d
Change-Id: I2ac92004c2ad3769c9749e131718a8ef0003c4bd
Partial-Bug: #1720727
2018-08-23 10:32:23 +00:00
Yushiro FURUKAWA
bca82e2fba Fix broken unittests
_clean() method is renamed to clean() in osprofiler 2.3.0.
It was suggested in a past neutronclient review.

Closes-Bug: #1783789
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Depends-On: https://review.openstack.org/#/c/592018/
Change-Id: Ic8e03db85dc08cfdcac5507e99ecdf7eac8eb972
2018-08-15 22:01:17 +09:00
chenyaguang
2bff68649b Set or unset port pair group failed
Set or unset port pair for port pair group failed
because the type of 'existing' is wrong

Change-Id: I198e745fccff76184d9813805d1c1915aff5a273
Closes-Bug: #1762884
2018-04-18 17:29:11 +08: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
Jens Harbott
bcffe1fce7 Fix list bgp speaker by agent ID
The arg is called "agent", not "agent_id".

Change-Id: I5dd524137202a5411451e775c7ca5d6748dc6e7a
Closes-Bug: 1762488
2018-04-09 17:28:27 +00:00
Hongbin Lu
f6b1e85899 Remove mox/mox3 usage from test_cli20.py
Change-Id: Ib4dc5f6c7ba57d94364f19a049c690d3817c723a
Partial-Bug: #1753504
2018-03-26 11:00:39 +00:00
Hongbin Lu
ce623030ee Remove mox/mox3 usage from lb modules
Change-Id: I667dd870b615d4a9ccefd35fcb1ebf15760b1d6d
Partial-Bug: #1753504
2018-03-24 10:29:42 +00:00
Hongbin Lu
260f74308e Remove mox/mox3 usage from fw modules
Change-Id: I913993c0bff15df19bf3978ed36062f970eef538
Partial-Bug: #1753504
2018-03-24 07:44:38 +00:00
Hongbin Lu
8dac1afd43 Remove mox/mox3 usage from bgp
Change-Id: Ie07cf987382281c00023b41ce74c314ec2457502
Partial-Bug: #1753504
2018-03-23 23:24:20 +00:00
Hongbin Lu
633a20cde9 Remove mox/mox3 from test_cli20_address_scope.py
Change-Id: Ibba1061d447a73bb3e13e1b8869300d2c0de1b16
Partial-Bug: #1753504
2018-03-23 22:05:02 +00:00
Zuul
685f1bd59d Merge "Remove mox/mox3 from test_cli20_agentschedulers.py" 2018-03-23 20:34:51 +00:00
Zuul
6200abf57d Merge "Remove mox/mox3 usage from test_cli20_securitygroup.py" 2018-03-23 18:29:26 +00:00
Hongbin Lu
bcce41e847 Remove mox/mox3 from test_cli20_agentschedulers.py
Change-Id: If1b9a9d1d16bed7c28b87bd47c30d5aaa05da546
Partial-Bug: #1753504
2018-03-23 16:54:47 +00:00
Zuul
55ecda7afb Merge "Remove mox/mox3 usage from test_cli20_subnet.py" 2018-03-22 09:34:52 +00:00
Zuul
1fd3b5403d Merge "Remove mox/mox3 usage from test_cli20_subnetpool.py" 2018-03-22 09:34:51 +00:00
Zuul
b40377676e Merge "Remove mox/mox3 usage from test_cli20_network.py" 2018-03-22 09:34:49 +00:00
Hongbin Lu
5a0d8c8b90 Remove mox/mox3 usage from test_cli20_securitygroup.py
Change-Id: I7d15d42ffd0cd94972809569633d6f4a38c60d4b
Partial-Bug: #1753504
2018-03-21 23:10:21 +00:00
Hongbin Lu
02b6e6f841 Remove mox/mox3 usage from test_cli20_subnet.py
Change-Id: I783260f6853a7ba6f911f718ce759b292595da4f
Partial-Bug: #1753504
2018-03-19 17:46:08 +00:00
Hongbin Lu
93e4ef2e7d Remove mox/mox3 usage from test_cli20_subnetpool.py
Change-Id: I26e15e051a9754f61d9ba04a59f62bc979e52fb1
Partial-Bug: #1753504
2018-03-19 17:44:12 +00:00
Hongbin Lu
c50b126771 Remove mox/mox3 usage from test_cli20_network.py
Change-Id: I3c9f53e57ef7fc38b0d4b2eb3138902004cff2b3
Partial-Bug: #1753504
2018-03-19 17:44:06 +00:00
Zuul
e0097be2ff Merge "Enable VPNaaS functional tests in the neutronclient gate" 2018-03-16 00:27:07 +00:00
Zuul
2ff067534e Merge "Fix the assertion of standard error text" 2018-03-15 23:22:42 +00:00
Zuul
c739c856e7 Merge "Remove mox/mox3 usage from test_name_or_id.py" 2018-03-15 23:22:41 +00:00
Zuul
b021c9b318 Merge "Remove mox/mox3 usage from test_cli20_port.py" 2018-03-15 23:11:20 +00:00