neutron/neutron/objects
Slawek Kaplonski 062336e59b Set system_scope='all' in elevated context
In case when enforce_new_defaults is set to True and new policy rules
are used, context.is_admin flag isn't really working as it was with old
rules.
But in case when elevated context is needed, it means that we need
context which has full rights to the system. So we should also set
"system_scope" parameter to "all" to be sure that system scope queries
can be done with such elevated context always.

It is needed e.g. when elevated context is used to get some data from
db. In such case we need to have db query which will not be scoped to
the single project_id and with new defaults to achieve that system_scope
has to be set to "all".

Proper fix for that should be done in neutron-lib and it is proposed
in [1] already but as we are have frozen neutron-lib version for
stable/wallaby already this patch for neutron is temporary fix for that
issue.
We can revert that patch as soon as we will be in Xena development cycle
and [1] will be merged and released.

[1] https://review.opendev.org/c/openstack/neutron-lib/+/781625

Related-Bug: #1920001
Change-Id: I0068c1de09f5c6fae5bb5cd0d6f26f451e701939
2021-03-19 12:05:56 +01:00
..
db remove the neutron.db._model_query module 2019-01-25 08:55:25 -07:00
extensions use objects common_types from neutron-lib 2019-11-26 15:34:18 +01:00
logapi use objects common_types from neutron-lib 2019-11-26 15:34:18 +01:00
plugins Fix queries to retrieve allocations with network_segment_range 2020-02-28 12:34:13 +00:00
port Add port device profile extension 2021-01-22 16:17:30 +00:00
qos Provide object tagging using the tag plugin 2021-01-18 11:57:39 +00:00
README.rst Objects: Add README for neutron/objects directory tree 2016-10-07 15:12:20 +00:00
__init__.py Bump pylint version to support python 3.8 2020-08-06 16:00:30 +02:00
address_group.py Allow sharing of address groups via RBAC mechanism 2021-03-01 18:28:31 -06:00
address_scope.py Allow sharing of subnet pools via RBAC mechanism 2020-04-09 19:02:47 +03:00
agent.py use objects common_types from neutron-lib 2019-11-26 15:34:18 +01:00
auto_allocate.py use objects common_types from neutron-lib 2019-11-26 15:34:18 +01:00
base.py Finish the new DB engine facade migration 2020-11-24 09:20:35 +00:00
conntrack_helper.py use objects common_types from neutron-lib 2019-11-26 15:34:18 +01:00
flavor.py use objects common_types from neutron-lib 2019-11-26 15:34:18 +01:00
floatingip.py use objects common_types from neutron-lib 2019-11-26 15:34:18 +01:00
ipam.py use objects common_types from neutron-lib 2019-11-26 15:34:18 +01:00
l3_hamode.py Finish the new DB engine facade migration 2020-11-24 09:20:35 +00:00
l3agent.py use objects common_types from neutron-lib 2019-11-26 15:34:18 +01:00
metering.py Add source_ip_prefix and destination_ip_prefix to metering label rules 2020-09-29 09:06:03 -03:00
network.py Remove redundant implementation of "get_projects" in NetworkRBAC 2020-04-17 08:48:15 +00:00
network_segment_range.py Provide object tagging using the tag plugin 2021-01-18 11:57:39 +00:00
port_forwarding.py In OVO PortForwarding, retrieve FIP info from db_obj 2021-01-16 00:06:49 +00:00
ports.py Implement "IPAllocation" router ports allocated retrieval 2021-02-25 10:46:12 +00:00
provisioning_blocks.py [OVO] Switch to use own registry 2017-11-22 17:44:22 +01:00
quota.py Fix invalid JSON generated by quota details 2021-03-15 19:24:49 +00:00
rbac.py Remove usage of six.add_metaclass 2020-05-21 14:41:18 -04:00
rbac_db.py Set system_scope='all' in elevated context 2021-03-19 12:05:56 +01:00
router.py Finish the new DB engine facade migration 2020-11-24 09:20:35 +00:00
securitygroup.py Add normalized_cidr column to SG rules 2021-01-07 12:23:59 +01:00
servicetype.py use objects common_types from neutron-lib 2019-11-26 15:34:18 +01:00
stdattrs.py Finish the new DB engine facade migration 2020-11-24 09:20:35 +00:00
subnet.py Set system_scope='all' in elevated context 2021-03-19 12:05:56 +01:00
subnetpool.py Set system_scope='all' in elevated context 2021-03-19 12:05:56 +01:00
tag.py Fix pep8 E128 warnings in non-test code 2019-03-12 21:22:33 +00:00
trunk.py Provide object tagging using the tag plugin 2021-01-18 11:57:39 +00:00

README.rst

Neutron Objects

Directory

This directory is designed to contain all modules which have objects definitions shipped with core Neutron. The files and directories located inside of this directory should follow the guidelines below.

Structure

The Neutron objects tree should have the following structure:

  • The expected directory structure is flat, except for the ML2 plugins. All ML2 plugin objects should fall under the plugins subdirectory (i.e. plugins/ml2/gre_allocation).
  • Module names should use singular forms for nouns (network.py, not networks.py).