Commit Graph

13 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez f9b91289a5 Add policy enforcer for "tags" service plugin
The following resources have been updated with new policies for
tags:
* Port
* Subnet
* Network
* Router
* FloatingIP
* NetworkSegmentRange
* NetworkSegment
* SecurityGroup
* Trunk
* Subnetpool

The admin can now enforce specific policies for the resource tags
for the creation, update and deletion actions.

NOTE: a follow-up patch, with a new Launchpad bug reference, will
      be created to move the ``Tagging`` class from
      ``ExtensionDescriptor`` to ``APIExtensionDescriptor``, and
      refactor the ``TaggingController`` to be a standard
      ``neutron.api.v2.base.Controller``. Any API resource using
      the second controller will use the path used by the wsgi
      hooks, in particular the policy hook. That will make unnecessary
      to manually call the ``policy.enforce`` method from the
      extension class methods.

Closes-Bug: #2037002
Change-Id: I9f3e032739824f268db74c5a1b4f04d353742dbd
2023-10-14 15:41:06 +00:00
Nurmatov Mamatisa ce3b86eef3 Use neutron-lib standard_attr
Now only neutron uses neutron/db/standard_attr.py
Shim can be removed

Change-Id: I980265335c5f3f6b5ee2e5fbcad9491aad91defe
2021-09-15 09:19:26 +00:00
Harald Jensås 35c7999ebd Allow 255 character strings in tags
In TripleO we are moving to a model where heat is not
used to manage neutron resources. This work relies on
using tags, and we are hitting the 60 characther limit.

This change bumps the tag elements to 255 characters.

Closes-Bug: #1921713
Change-Id: Ie69526acb94b62fd5d8db1dbddc1f24072df7a5e
2021-03-30 10:44:39 +02:00
Brian Haley 08a60f7483 Remove usage of six.add_metaclass
With python 3.x, classes can use the metaclass= logic
to not require usage of the six library.

One step in removing all of six usage from neutron.

Change-Id: I2f815e412d9a96eb5faf2b3bb3a1e393a9db9309
2020-05-21 14:41:18 -04:00
Miguel Lavalle e22a191f47 Implement tagging during bulk port creation
This change proposes a ML2 plugin extension to implement tagging during
bulk port creation.

Change-Id: Ic70f7d282db478c69016ab1c317c5cae786401ce
Related-Bug: #1815933
2020-01-28 18:23:37 -06:00
Boden R 024802aafd remove neutron.common.rpc
The neutron.common.rpc module has been in neutron-lib for awhile now and
neutron is shimmed to use neutron-lib already.
This patch removes neutron.common.rpc and switches the code over to use
neutron-lib's implementation where needed.

NeutronLibImpact

Change-Id: I733f07a8c4a2af071b3467bd710290eee11a4f4c
2019-02-06 11:05:55 -07:00
Hongbin Lu 8b19db164a Annotate filter parameters for tag attributes
* Add additional attributes 'tags-any', 'not-tags' and 'not-tags-any'
  to the attribute map. These three attributes represent the query
  parameters on list request.
* Add 'is_filter' keyword for attributes 'tags', 'tags-any', 'not-tags'
  and 'not-tags-any'. This indicates that these four attributes can be
  used as filter parameters. In the future, we will rely on this metadata
  to perform filter validation: https://review.openstack.org/#/c/554368/

Change-Id: I9e2033e7ba9d198f96c1ce6089a809d6721dd82d
Related-Bug: #1749820
2018-06-11 19:02:43 +00:00
Boden R 87a36cacc6 remove tag and tag_ext extensions
The tag and tag_ext extensions are deprecated for removal, but are not
used widely today [1]. Rather than rehoming these extensions to
neutron-lib and carrying out their deprecation life-cycle for no
apparent reason, this patch proposes we just remove them now.

While [2] initially removed these extensions, we had to revert
them with [3].

Depends-On: I295a5b84eb7fa3439561fa009b7499f94d8df4d2

[1] http://codesearch.openstack.org/?q=from%20neutron.extensions%20import%20(tag_ext%7Ctag)
[2] I0d7bcd789b468b1dd3f7ea13e6751a46203d6778
[3] If16443616eee703b66d57b6422dd451a443fbc64

Change-Id: I97095453610fff114d999a526d67e78119546ff5
2018-03-16 13:09:42 -06:00
Hongbin Lu 4904455bf2 Revert "remove tag and tag_ext extensions"
It looks this patch breaks Zun's gate. The reason might be
that Zun depends on Kuryr-libnetwork which still use the
legacy tag extension. I propose to revert this for now and
give the kuryr team some time to migrate to the new extension.

This reverts commit 38148d1752.

Change-Id: If16443616eee703b66d57b6422dd451a443fbc64
2018-02-14 06:32:30 +00:00
Boden R 38148d1752 remove tag and tag_ext extensions
The tag and tag_ext extensions are deprecated for removal, but are not
used today [1]. Rather than rehoming these extensions to neutron-lib and
carrying out their deprecation life-cycle for no apparent reason, this
patch proposes we just remove them now.

[1] http://codesearch.openstack.org/?q=from%20neutron.extensions%20import%20(tag_ext%7Ctag)

Change-Id: I0d7bcd789b468b1dd3f7ea13e6751a46203d6778
2018-02-12 09:04:15 -07:00
Gary Kotton 5da1a6f7c6 Tags: harden validations
An invalid input would cause a server execption. We now validate
that the body in the tags validation is not None.

TrivialFix

Change-Id: I97a00ee6d2672485334bba757706f107e052b551
Closes-Bug: #1736678
2017-12-11 23:04:05 -08:00
Boden R 0e25b403a5 use FAULT_MAP from neutron-lib
Idfd956fa213e1ba6c3b1c983f246c5b515951e6d rehomed the FAULT_MAP into
neutron-lib. This patch consumes it from lib and removes its definition
from neutron.

NeutronLibImpact

Change-Id: Ib051555ea8496ed7eec8ed30733c964012e31c32
2017-11-02 12:16:31 -06:00
Hirofumi Ichihara 96f0142b80 Tag mechanism supports resources with standard attribute
Tag mechanism supports network, subnet, port, subnetpool
router resources only. This patch allow tag mechanism to support
 resources with standard attribute.

Two old extenions are kept because of backward compatibility.
They will be removed in Queens release.

APIImpact: Tag is supported by resources with standard attribute
DocImpact: allow users to set tags on resources with standard attribute

Change-Id: Id7bb13b5beb58c313eea94ca03835d3daf5c94bc
Closes-Bug: #1682775
2017-07-25 08:14:04 +09:00