Commit Graph

1032 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
elajkat b9152a5042 OSC: Remove SFC V2 calls to neutronclient
Change SFC CLI to use SDK instead of deprecated neutronclient
python bindings.
Add possibility to delete multiple resources as it is common
for other delete commands.
Bump SDK minimum version to 1.5.0.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/887387
Actually the new SDK release is the dependency.
Related-Bug: #1999774
Change-Id: Ic22b8163155904113db8a4acf1fe7d75ae100a84
2023-09-08 15:54:02 +02:00
elajkat 396432ab06 OSC: Remove VPNAAS V2 calls to neutronclient
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/886822
Actually the new SDK release is the dependency, so bump
minimum SDK version to 1.5.0.

Change-Id: I1933dceb3dc28b464e6e9c4ce468abbd03a00ba4
Related-Bug: #1999774
2023-09-08 15:53:44 +02:00
elajkat fccfe8c3e5 OSC: Remove FWAAS V2 calls to neutronclient
Bump SDK min version to 1.5.0.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/883859
Related-Bug: #1999774
Change-Id: I1588ffa8035c2a4f558c6d3a630287542c718be4
2023-09-06 10:22:20 +02:00
Zuul d497615240 Merge "BGPVPN: make resource_association method calls logic simpler" 2023-06-22 16:03:42 +00:00
Zuul 4521472198 Merge "Remove 'bgp speaker show dragents'" 2023-05-29 14:38:18 +00:00
elajkat 4ed299ad39 BGPVPN: make resource_association method calls logic simpler
This is a FUP based on the following comment:
https://review.opendev.org/c/openstack/python-neutronclient/+/875728/comment/c2f44683_82cffdbc/

Change-Id: I84fe4bb45d24c2f4a7a0246e2b9fb50354a715e0
Related-Bug: #1999774
2023-05-24 13:23:01 +02:00
elajkat d4124aed1f OSC: Remove BGPVPN calls to neutronclient
With [1] the python binding code in Neutronclient prints warning
about future deprecation, change networking-bgpvpn osc client
code to use totally OpenstackSDK.

[1]: https://review.opendev.org/c/openstack/python-neutronclient/+/862371

Change-Id: Iae1378ffabda3d30257e35a6148e205a9f495eb5
Related-Bug: #1999774
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/875530
2023-05-24 11:53:33 +02:00
Stephen Finucane 79c7de4630 Remove 'bgp speaker show dragents'
This has been deprecated for ages and generates an annoying warning when
building OSC docs. Time to cull it.

Change-Id: I76e4c7ab742d0bf27fecfda8fab41035618a4e24
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-17 13:04:37 +01:00
Zuul d342171f9e Merge "OSC: Remove BGP calls to neutronclient" 2023-05-02 15:49:07 +00:00
Slawek Kaplonski 52653c95e0 Remove the CLI code from the Neutron client.
This project no longer provides CLI support. All code has been
removed. Please use openstack CLI instead

This patch removes entry point for neutron CLI too, bash completion
script and CLI related functional and unit tests but it
still keeps neutronclient/neutron/v2_0 module as this is used by e.g.
Nova.

Co-Authored-By: Slawek Kaplonski <skaplons@redhat.com>

Closes-Bug: #2003861
Change-Id: I5b6c735d1ff931d7991a42b262e7faa47b75edeb
2023-04-11 13:12:45 +02:00
elajkat 0b271d3b8c OSC: Remove BGP calls to neutronclient
With [1] the python binding code in Neutronclient prints warning
about future deprecation, change neutron-dynamic-routing osc client
code to use totally OpenstackSDK.

[1]: https://review.opendev.org/c/openstack/python-neutronclient/+/862371

Related-Bug: #1999774
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/869485
Depends-On: https://review.opendev.org/c/openstack/requirements/+/873598
Change-Id: I5dd143e670b70cc42a2ae48fe4bac0cf09416cb5
2023-03-03 13:16:15 +00:00
Rodolfo Alonso Hernandez 16a2cd127d Remove CLI warning message
This warning was added in [1]. This patch is partially reverting it
but we keep the release note. This warning message could be a bit
intrusive for those users still using it. In any case, the
recommendation to move to OSC is something already known and
publicly requested.

[1]https://review.opendev.org/c/openstack/python-neutronclient/+/862371

Change-Id: I0c2fba3e45a9de1eba09efcf8919661a855c7e89
2023-02-14 08:30:20 +01:00
elajkat 68cbf56f9c Move network trunk commands from python-neutronclient
The depends-on patch adds trunk commands to OSC, as we can
long consider trunk operations as core Networking operations.

Change-Id: Ie557a5d541cf117d20f3f2b548620a74dbadb383
Depends-On: https://review.opendev.org/c/openstack/python-openstackclient/+/869447
Related-Bug: #1999774
2023-01-16 14:18:27 +01:00
Elvira García 776e360e35 Fix help sentence in network log create --enable
As the documentation states [1], the default in network log objects is
to be enabled, not disabled.

[1] https://docs.openstack.org/neutron/latest/admin/config-logging.html

Change-Id: I13e9d1132fc38104e6e85d9c8442bc7506adc2fd
2022-11-25 15:32:46 +01:00
elajkat f67af3d9be Add warning and reno for SDK
On the 2023.1 (Antelope) PTG we discussed the status of the python
binding (SDK) code in python-neutronclient and decided to not allow new
features to this repo (see [1]), and make users to use openstacksdk.
Let's add a warning log message and a releasenote to make it visible.

[1]: https://etherpad.opendev.org/p/neutron-antelope-ptg#L163

Change-Id: I03317179bd0d30a69b91eef6e451b8e40eb28191
2022-10-21 16:40:38 +02:00
Pedro Henrique 7467c710f6 Add support to floating ip port forwarding
To extend Horizon to allow users to create
port forwarding rules for their floating ips,
we need to extend this client to allow it,
as Horizon uses this client.

This patch is the one of a series of patches
to implement floating ip port forwarding with
port ranges.

The specification is defined in:
https://github.com/openstack/neutron-specs/blob/master/specs/wallaby/port-forwarding-port-ranges.rst

Implements: blueprint floatingips-portforwarding-ranges
Related-Bug: #1885921
Change-Id: I3f616dba5e2ebe301cf6ce4bed8c2e6e4da2da9b
2022-07-15 10:06:03 -03:00
Zuul 6ca3341352 Merge "Add support for 'smart-nic' vnic-type" 2022-01-19 23:35:59 +00:00
Zuul d75e1e05b7 Merge "Add CURD actions for packet rate limit rule" 2021-12-06 15:32:48 +00:00
LIU Yulong a92d8db81c Add CURD actions for packet rate limit rule
Neutron added new QoS rule [1] for packet rate limit.
Neutron fullstack test cases [2] rely on the neutron client
to interact with the neutron-server (API), so for new QoS rule
`packet rate limit`, we add the needed methods for new
cases of the QoS driver testing.

[1] https://docs.openstack.org/api-ref/network/v2/index.html#qos-packet-rate-limit-rules
[2] https://github.com/openstack/neutron/blob/master/neutron/tests/fullstack/resources/process.py#L24

Change-Id: I0ad236c9e585a25fbd405813ac48898a2df897d2
2021-11-24 00:23:08 +00:00
Przemyslaw Szczerbik 3b80135a3d Add support for minimum packet rate rule to the client
With the introduction of QoS minimum packet rate rule in Neutron,
it's important to ensure that tools like Heat support it as well.
Unfortunately, Heat still depends on python-neutronclient instead
of python-openstackclient. So even though QoS minimum packet rate
rule support have been proposed for python-openstackclient [1] and
openstacksdk [2], it's still necessary to extend python-neutronclient
code. Since Heat uses only the client part, can skip CLI support.

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/810559
[2] https://review.opendev.org/c/openstack/openstacksdk/+/810364

Partial-Bug: #1922237
See-Also: https://review.opendev.org/785236
Change-Id: I4f16b963a202a476cd3cd2b69c1dd4e4ee6f0fc7
2021-11-19 08:05:56 +01: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
Zuul 4b29df7234 Merge "Replace deprecated assertDictContainsSubset" 2021-09-06 12:27:22 +00:00
Takashi Kajinami cff9c266c0 Replace deprecated assertDictContainsSubset
The method is deprecated since Python 3.2[1] and shows the following
DeprecationWarning.

/usr/lib/python3.9/unittest/case.py:1134: DeprecationWarning:
assertDictContainsSubset is deprecated
  warnings.warn('assertDictContainsSubset is deprecated',

[1] https://docs.python.org/3/whatsnew/3.2.html#unittest

Closes-Bug: #1938103
Change-Id: I1d0ee6c77476707a7e4fe4fbf2b979bf34550d05
2021-09-05 00:56:38 +09:00
Zuul 983f0abc58 Merge "Use yaml.safe_load instead of yaml.load" 2021-09-02 02:27:46 +00:00
Takashi Kajinami f83108d858 Use yaml.safe_load instead of yaml.load
Since PyYAML 5.1, yaml.load without specifying the Loader option is
deprecated and shows the following warning.

YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated,
as the default Loader is unsafe.
Please read https://msg.pyyaml.org/load for full details.

This change replaces usage of yaml.load by yaml.safe_load, to get rid
of that warning message.

Change-Id: Ibe25c4aaf3aa7226f28ec60b8a929ecc143face1
2021-09-01 17:53:41 +09:00
Zuul e647baf4ca Merge "Ussuri+ is python3 only and update python to python3" 2021-09-01 07:43:35 +00:00
Bernard Cafarelli 2f047b1595 Set ML2/OVS backend explicitly for functional job
After default backend change to OVN, some client tests related to DHCP
or L3 agents are not working fine. Switch the job to ML2/OVS, as it was
done in openstack-client in changeset
Idf6466a59c6cf96be2f1d53e696f0564584fa233

test_neutron_dhcp_agent_list_hosting_net was skipped temporarily
to pass the gate in the parent commit. It is re-enabled now.

Change-Id: I91d03d13adcd38d46ba1b042239a290ae2c99ea4
Closes-Bug: #1936965
2021-07-27 15:29:10 +09:00
elajkat 23fb666f92 tests: change safe_hasattr to hasattr
testtools 2.5.0 removed the helper (see [0]) safe_hasattr, and assumes
that the hasattr implementation in python reliable enough now.

test_neutron_dhcp_agent_list_hosting_net is skipped temporarily
as there is no DHCP agent with ML2/OVN. It will be re-enabled [1].

[0] https://github.com/testing-cabal/testtools/blob/2.5.0/NEWS#L31
[1] https://review.opendev.org/c/openstack/python-neutronclient/+/801997

Change-Id: I4fe6fabc4f745e2c9a366e30dbea7e7200151f12
2021-07-27 14:56:36 +09:00
dengzhaosen a1ebfaa7f2 Ussuri+ is python3 only and update python to python3
To remove the useless shebang

Change-Id: I611c5bc47562f8def9a8623117b7b0655474b555
2021-06-24 01:43:09 +00:00
Slawek Kaplonski 76dd26f9fd Set when deprecated neutron client CLI will be removed
[1] was the last missing bit in OSC to have feature parity between
OpenStack client and Neutronclient CLI tools.
So now as [1] is merged we can really deprecate and specify that in Z
cycle we will remove neutronclient CLI.
This patch changes deprecation message to reflect that.

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/768210

Change-Id: Ia68af29ea15bda7330fda1b18416798a0f4cb7a4
2021-05-27 12:09:32 +00:00
Slawek Kaplonski 439e290e95 Skip metering functional tests when metering extension is not enabled
Change-Id: I9e3f41a2be56c1fd5fc3aff9af8e5ff5163087bd
2021-05-27 14:07:21 +02:00
likui 2c2a1f4de7 Replace getargspec with getfullargspec
inspect.getargspec() is deprecated since py3

[1] https://docs.python.org/3/library/inspect.html#inspect.getargspec

Change-Id: I2ae460a7a7f01d7346d5e51ec6ccb44c22d0c53e
2021-05-10 18:09:17 +08:00
sri harsha mekala 3140fe014a Support passing mTLS certificate/key to HTTPClient
Change-Id: I00065293daf6b2e5d540e056c05f85b82f8bc72c
2021-03-05 11:48:03 -08:00
Zuul 62c187f5c7 Merge "Allow 4byte ASNs in dynamic routing client" 2020-09-08 22:00:12 +00:00
Zuul e999631422 Merge "Add aggressive negotiation mode for ikepolicy" 2020-09-08 22:00:10 +00: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
Jens Harbott d1e5afb351 Fix description of bgp speaker set arg
The name argument for bgp speaker set defines the new name for the speaker,
make the description more clear about this.

Change-Id: I29a0c87214c3c60084d0541f8b9a7abc72ff987f
2020-07-12 21:14:40 +00:00
Hervé Beraud f751dd3782 Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Change-Id: Ia7226d968b8594677fc8dea664b58a80ba193ac5
2020-06-09 19:01:23 +02:00
Zuul 8d4020ec23 Merge "Use unittest.mock instead of third party mock" 2020-06-05 11:53:23 +00:00
Zuul d8ba5c2341 Merge "Stop to use the __future__ module." 2020-06-04 10:01:42 +00:00
Zuul fe61e8a25c Merge "Add segments client code" 2020-06-03 08:20:46 +00: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
Sean McGinnis 4669bcc628
Use unittest.mock instead of third party mock
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>
2020-06-01 07:57:23 -05:00
elajkat 626970a353 Add segments client code
Related-Bug: #1878632
Needed-By: https://review.opendev.org/728904

Change-Id: I85b8e7b3fb84e7e9fd133edffc300a83eeb7c56d
2020-05-18 14:14:38 +00: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
zhanghao c8d61703c2 Add aggressive negotiation mode for ikepolicy
The phase1 negotiation mode adds support for aggressive mode,
which can be selected when creating an ikepolicy.

Change-Id: I8148011558094db07b5f9eba70b16cfe6eeaf98f
Partial-Bug: #1701413
2020-05-13 08:46:26 -04: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
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