Commit Graph

1178 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez 9db26809f9 Enable filtering flag in subnet 'router:external' field
This flag was incorrectly set to False in the API extension
implementation. This extension is still not implemented in Neutron.

Change-Id: I87ea4e8bf4b4bc6a6934a349ac28765107c1536a
Related-Bug: #2051831
2024-03-08 01:18:58 +00:00
Rodolfo Alonso Hernandez 3a9e39b9ef [netaddr>=1.0.0] Do not use netaddr.core.ZEROFILL flag with IPv6
The flag "netaddr.core.ZEROFILL" cannot be used with IPv6 addresses
with netaddr>=1.0.0

Change-Id: I116ea2abbee13a73302ebca9c65707f427a7d9d0
Closes-Bug: #2055173
2024-02-29 08:33:13 +00:00
Rodolfo Alonso Hernandez f0724e9cf1 Skip the enforcer undefined rule check
That will avoid unnecessary warning messages in the logs. The
role enforcer only loads the following 3 rules:
* _ADMIN_CTX_POLICY = 'context_is_admin'
* _ADVSVC_CTX_POLICY = 'context_is_advsvc'
* _SERVICE_ROLE = 'service_api'

This functionality was implemented in [1]. oslo.policy library
is bumped to version 4.3.0 that contains this patch.

[1]https://review.opendev.org/c/openstack/oslo.policy/+/907196

Closes-Bug: #2048198
Change-Id: I1581b95035c4afebf63518b64c35bc0c61c292e9
2024-02-23 00:52:29 +00:00
Zuul d131b53403 Merge "Add extension "subnet-external-network"" 2024-02-23 16:26:12 +00:00
Zuul 8ce8b7214e Merge "Remove constants for LBaaS(v2)" 2024-02-22 18:21:05 +00:00
Zuul b3fe0ead28 Merge "Add "socket" NUMA affinity policy" 2024-02-22 18:21:03 +00:00
Ihar Hrachyshka 577c7bae0d rpc: reuse existing defaultdict when setting max_timeout
Change-Id: I6655f075bdf67e34bde97770760c6616bc582ea0
2024-02-14 18:33:23 +00:00
Ihar Hrachyshka 631e3f995c rpc: initialize notifier when get_notifier is called
This is to mimic other get_ (server, client) entry points.

Change-Id: Iabcf6e43fca40e7dbdd83345b2cd6d32cb25d3d8
2024-02-14 18:33:23 +00:00
Ihar Hrachyshka 1fedbae833 rpc: don't explicitly pass access_policy
The passed value is the default in oslo.messaging, so the argument is
redundant.

Change-Id: Iaa82d6141cfc300705bb2c4f430df2a092ec5aee
2024-02-14 18:33:23 +00:00
Ihar Hrachyshka 8169a79a4d rpc: explain how get_notifier arguments actually work
Arguably, using `None` as service name by default is probably wrong, but
I don't think we can safely change it now.

Change-Id: Iad19f1af0019b40fc5618fc55647ccd7553f2272
2024-02-14 18:33:23 +00:00
Ihar Hrachyshka 23b1fbc3b3 rpc: fix some typos
Change-Id: I3669e11839a99e7d1f60b5be16f1097295196628
2024-02-14 18:33:23 +00:00
Artom Lifshitz 7eeb1b87ac Add "socket" NUMA affinity policy
The "socket" NUMA affinity policy has been supported in Nova since [1].

[1]https://review.opendev.org/c/openstack/nova/+/773792

Related-Bug: #2052786
Change-Id: Id84f3f5c83a1452875f2d7adf4611db319c240ce
2024-02-13 06:56:20 +00:00
Rodolfo Alonso Hernandez fc2f383dd6 Add extension "subnet-external-network"
This extension adds a new field to the "subnet" resource:
"router:external". This boolean field, that is False by default,
represents if the subnet belongs to an external network.

Related-Bug: #2051831
Change-Id: I75a9c30f1e8031d40a548df345b02fbe0bc47706
2024-02-09 09:24:38 +00:00
Zuul 35455d101b Merge "Replace CRLF by LF" 2024-02-08 17:09:48 +00:00
Zuul 0ffe4a045a Merge "[sqlalchemy-20] Use sqlalchemy.orm.DeclarativeBase" 2024-02-05 13:02:52 +00:00
Takashi Kajinami 122227e9e6 Replace CRLF by LF
... because LF is now commonly used as newline code.

Change-Id: I671bc10cb7cbe6e64e9ef96da859242631cc0eeb
2024-01-27 12:33:40 +09:00
Zuul 8c5dd8d373 Merge "Add some neutron constants" 2024-01-26 10:45:22 +00:00
Zuul ba24f0841e Merge "Add Tap Mirror exception" 2024-01-26 10:45:21 +00:00
Zuul 06ed5488a7 Merge "Tap mirror API def and API ref" 2024-01-26 10:44:09 +00:00
elajkat 584de2c144 Add Tap Mirror exception
Add TapMirrorNotFound and TapMirrorTunnelConflict to
taas exceptions.

Change-Id: I96413cdeaa85f8f52c80a5e6dd72e0ddaa2e10ed
Related-Bug: #2015471
2024-01-25 14:03:05 +00:00
elajkat 72442e0ba0 Tap mirror API def and API ref
Change-Id: Ifa1bf6abbf5d25769820b545d8d3bab195b146d3
Related-Bug: #2015471
2024-01-25 14:59:57 +01:00
Thomas Goirand c8754d1e5d Python-3.12: do not use datetime.datetime.utcnow()
This is deprecated in the favor of:
oslo_utils.timeutils.utcnow()

Change-Id: Iaf95c602b4ead7128850625140b7b3bde132ebf6
2024-01-25 06:46:44 +00:00
Rodolfo Alonso Hernandez 7909696a90 [sqlalchemy-20] Use sqlalchemy.orm.DeclarativeBase
``declarative_base()`` is superseded by ``DeclarativeBase`` class.
More information in [1].

[1]https://docs.sqlalchemy.org/en/20/changelog/whatsnew_20.html#step-one-orm-declarative-base-is-superseded-by-orm-declarativebase

Closes-Bug: #2051171
Change-Id: I5ddf9573572e52fe87bbfde9732c5af9ce398188
2024-01-21 00:03:11 +00:00
Takashi Kajinami c69701eb73 Bump hacking
hacking 3.0.x is really old. Let's bump it to the latest version
available.

This also fixes some errors detected but some rules are excluded now.
See the comments in tox.ini for further details.

Change-Id: I2565e5f5e791dfdd9bbc1890b35c413965d83626
2024-01-16 16:56:54 +00:00
Brian Haley 1dbf0f4558 Add some neutron constants
Copied some constants and an exception based on TODO
comments, so we can consume in the future.

TrivialFix

Change-Id: Iac9070c840a3276b5805d8c58437da3363890f67
2024-01-11 16:55:43 -05:00
Takashi Kajinami 9081c39100 Remove constants for LBaaS(v2)
Neutron LBaaS and LBaaS v2 were both retired in favor of Octavia.
The remaining usage of these constants are being removed from neutron
by the dependent change.

Depends-on: https://review.opendev.org/c/openstack/neutron/+/902048
Depends-on: https://review.opendev.org/c/openstack/networking-sfc/+/902216
Depends-on: https://review.opendev.org/c/openstack/neutron-fwaas/+/902215
Change-Id: I6ea221f397e4dbb919480bde3ed89fe6acc025b8
2023-12-03 05:56:33 +00:00
Zuul 9e3a3a6086 Merge "Update default for BFD/ECMP router extra attributes" 2023-12-01 17:22:33 +00:00
Zuul 64c6937216 Merge "Add the "cancellable" flag to the ``CallbacksManager`` events" 2023-11-15 23:07:08 +00:00
Zuul 06b602d6a1 Merge "Change test_sqlalchemytypes.py to support sqlalchemy 2.0" 2023-11-14 17:24:34 +00:00
Zuul 46987a9ce8 Merge "vpnaas: add support for more ciphers (auth, encryption, pfs modes)" 2023-11-13 20:24:26 +00:00
Brian Haley 825d292c97 Change test_sqlalchemytypes.py to support sqlalchemy 2.0
With the move to sqlalchemy 2.0 some of the API methods
have changed, but these tests were never updated.

Also added an sqlalchemy-master job so we do not regress.

Depends-on: https://review.opendev.org/c/openstack/requirements/+/900517
Closes-bug: #2043141

Change-Id: I9e1c796dcda725844ea6b7a0d5c8a8c11560b2b3
2023-11-09 18:24:35 -05:00
Bodo Petermann b7598dab47 vpnaas: add support for more ciphers (auth, encryption, pfs modes)
Encryption algorithms: add AES CCM mode and AES GCM mode variants
for 128/192/256 bit keys and 8/12/16 octet ICVs.
Auth algorithms: add aes-xcbc and aes-cmac.
PFS: add Diffie Hellman groups 15 to 31.

Related-Bug: #1938284
Change-Id: Iba86fe9a1bbf88223b57a45fb89349c6b1858015
2023-10-24 13:18:59 +02:00
Rodolfo Alonso Hernandez 08b8c6d33b Add the "cancellable" flag to the ``CallbacksManager`` events
The ``CallbacksManager`` class considers, by default, that the events
starting with "before_" and "precommit_" can raise an Exception
(``CallbackFailure``) in case that the callbacks associated to these
methods exit with an error.

However there are some other events (those started with "after_") that
won't generate an exception in case of error. The error will be logged
but the process will continue.

This new functionality adds the possibility of adding any kind of event
and mark is as "cancellable". The ``CallbacksManager`` instance will check
the errors returned by the callback methods and if any of them is marked
as "cancellable", the manager will raise a ``CallbackFailure`` exception,
terminating the process.

In case of being a Neutron worker, for example, the
``oslo_service.service.Services`` class will restart the process again.

Related-Bug: #2036607
Change-Id: Ie1e7be6d70cca957c1b1b6c15b402e8bc6523865
2023-09-12 04:32:26 +00:00
OpenStack Proposal Bot 1da71876b8 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I08764d0494ac862239b0325a9eb410182b269165
2023-09-08 04:35:06 +00:00
Frode Nordahl a29e4a513e
Update default for BFD/ECMP router extra attributes
During review of the series it was requested to make the default
values for 'enable_default_route_bfd' and
'enable_default_route_ecmp' configurable.

In order to determine the correct value at runtime, Neutron needs
the attributes to be filled with something other than 'True' or
'False' when not provided in the request.

Needed-By: I581f4c5e5cfa275f8a6f0adec405f205e877ac55
Related-Bug: #2002687
Change-Id: I9096685fb79a84e11a8547a5aaa16f7f2df48a56
2023-08-29 12:01:30 +02:00
Zuul 4f862daccc Merge "Add RP_TUNNELLED and TRAIT_NETWORK_TUNNEL constants" 2023-07-28 17:01:11 +00:00
Zuul 8c72e2eee9 Merge "Revert "Add "network" to the EXT_PARENT_RESOURCE_MAPPING"" 2023-07-22 15:06:56 +00:00
Slawek Kaplonski 5df6e93b59 Revert "Add "network" to the EXT_PARENT_RESOURCE_MAPPING"
This reverts commit a014720912.

Reason for revert: It is not needed to have network in the EXT_PARENT_RESOURCE_MAPPING as we will keep NET_OWNER rules and use
them for subnets and ports API.
Please see [1] for more detailed explanation why it's better to keep NET_OWNER rules for those policies.

[1] https://review.opendev.org/c/openstack/neutron/+/889153

Change-Id: Ia2cd6301e04ac502888ee2b8042ea8c19873a95a
2023-07-21 08:19:12 +00:00
Rodolfo Alonso Hernandez 884f2add0b Add RP_TUNNELLED and TRAIT_NETWORK_TUNNEL constants
Related-Bug: #1991965
Change-Id: Icf0b4dec9420d342431549589f05c639e59a207c
2023-07-19 13:29:15 +00:00
Zuul 3bc1219d56 Merge "Fix the default value for ``hardware_offload_type`` field" 2023-07-17 14:55:34 +00:00
Miguel Lavalle c958933fa0 Add new callbacks event for resouce status update
A new event AFTER_STATUS_UPDATE is added, that will be published to
callbacks when a resource's status is updated in the DB. The first use
of this new event is to indicate when the L3 DB layer has updated
floating IPs status.

Change-Id: I1a85d1af7b4f50a5319c64e47c52ccdaa345e362
Partial-Bug: #2020823
2023-07-11 12:42:50 -05:00
Zuul 8e5b6955d2 Merge "Removed ``HasProjectPrimaryKeyIndex`` class" 2023-07-07 20:48:22 +00:00
Rodolfo Alonso Hernandez 61029af216 Fix the default value for ``hardware_offload_type`` field
In the 'port-hardware-offload-type' extension, the default value for
``hardware_offload_type`` should be ATTR_NOT_SPECIFIED, in case this
value is not defined in the API call when creating a new port.

NOTE: this extension is still under development thus it is legit to
modify it.

Related-Bug: #2013228
Change-Id: I7aadac451c59388c3d647f4ec5380e18a72c67be
2023-07-04 09:07:51 +00:00
Rodolfo Alonso Hernandez 673e48a189 Removed ``HasProjectPrimaryKeyIndex`` class
A column that is primary key creates an index by default. There is no
need to create another one by passing index=True.

Related-Bug: #2024044
Change-Id: Ie74934754598292b125d2be7edb4bbcbb898a230
2023-07-03 07:45:13 +00:00
Slawek Kaplonski 8ccdecc7d1 Add is_service_role property to the context class
As we are moving to the new S-RBAC policies, we want to use "service"
role for all service to service communication. See [1] for details.

This require from Context class property similar to old "is_advsvc" but
with new naming convention and using new policy rule.

This patch adds this new property together with all required policies
and rules.
For now "ContextBase.is_advsvc" property will return True if one of the
advsvc OR service_role will be True to make it working in the same way
with both old and new policies but once we will get rid of the old
policies we should also remove is_advsvc property from the ContextBase
class.

[1] https://governance.openstack.org/tc/goals/selected/consistent-and-secure-rbac.html#phase-2

Change-Id: Ic401db8b4e2745234e61fe2c05afd5b4ab719a03
2023-06-30 15:56:20 +02:00
Zuul d5acebbe7b Merge "Add port hardware offload extension" 2023-06-28 09:01:27 +00:00
Zuul 93a97d3be0 Merge "Add "network" to the EXT_PARENT_RESOURCE_MAPPING" 2023-06-26 17:42:59 +00:00
Slawek Kaplonski a014720912 Add "network" to the EXT_PARENT_RESOURCE_MAPPING
It's needed so network can be used as ext_parent for e.g. subnets in
the API policy rules.

Related-bug: #2023679
Change-Id: Ib446dffcd60e18b578a4d816ab5881e2fabc3e51
2023-06-26 10:58:41 +00:00
Rodolfo Alonso Hernandez 972fbdd4be Add port hardware offload extension
This new new port extension allows to create ports with hardware
offloaded capabilities.

Spec: https://review.opendev.org/c/openstack/neutron-specs/+/882272

Related-Bug: #2013228
Change-Id: I0c9863ff21f3dee6120f1c8424a69ded6c3612b1
2023-06-21 18:01:35 +00:00
Rodolfo Alonso Hernandez 1763eeeb06 Remove unnecessary required extension for "network_ha" extension
The L3 "router" extension is not needed for "network_ha". Furthemore,
this L3 "router" extension cannot be used with all ML2 plugins (for
example ML2/OVN uses "ovn-router" instead)

Related-Bug: #2016198
Change-Id: I949cbd7e27b2183200b58878b45ed7c1d7b3d7a7
2023-06-20 17:45:12 +00:00