neutron/neutron/db
Ihar Hrachyshka 6f83466307 Allow objects to opt in new engine facade
New facade is enabled by setting new_facade = True for the object of
interest. With new_facade on, all OVO actions will use the new reader /
writer decorator to activate sessions.

There are two new facade decorators added to OVO: db_context_reader and
db_context_write that should be used instead of explicit
autonested_transaction / reader.using / writer.using in OVO context.

All neutron.objects.db.api helpers now receive OVO classes / objects
instead of model classes, since they need to know which type of engine
facade to use for which object. While it means we change signatures for
those helper functions, they are not used anywhere outside neutron tree
except vmware-nsx unit tests, and the latter pass anyway because the
tests completely mock out them disregarding their signatures.

This patch also adds several new OVO objects to be able to continue
using neutron.objects.db.api helpers to persist models that previously
didn't have corresponding OVO classes.

Finally, the patch adds registration for missing options in
neutron/tests/unit/extensions/test_qos_fip.py to be able to debug
failures in those unit tests. Strictly speaking, this change doesn't
belong to the patch, but I include it nevertheless to speed up merge in
time close to release.

There are several non-obvious changes included, specifically:

- in neutron.objects.base, decorator() that refreshes / expunges models
from the active session now opens a subtransaction for the whole span of
call / refresh / expunge, so that we can safely refresh model regardless
of whether caller opened another parent subtransaction (it was not the
case for create_subnetpool in base db plugin code).

- in neutron.db.l3_fip_qos, removed code that updates obj.db_model
relationship directly after corresponding insertions for child policy
binding model. This code is not needed because the only caller to the
_process_extra_fip_qos_update method refetches latest state of floating
ip OVO object anyway, and this code triggers several unit test failures.

- unit tests checking that a single commit happens for get_object and
get_objects are no longer valid for new facade objects that use reader
decorator that doesn't commit but close. This change is as intended, so
unit tests were tweaked to check close for new facade objects.

Change-Id: I15ec238c18a464f977f7d1079605b82965052311
Related-Bug: #1746996
2018-02-09 04:07:34 +00:00
..
allowed_address_pairs Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
availability_zone use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
extra_dhcp_opt Cleanup _find_related_obj 2017-02-25 06:29:33 +00:00
metering Use Router OVO in metering_db 2018-01-16 09:50:57 +07:00
migration [L3][QoS] Neutron server side Floating IP QoS 2017-11-29 16:45:38 +08:00
models use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
network_dhcp_agent_binding OVO for NetworkDhcpAgentBinding 2017-09-08 15:48:00 +00:00
port_security Cleanup _find_related_obj 2017-02-25 06:29:33 +00:00
qos [L3][QoS] Neutron server side Floating IP QoS 2017-11-29 16:45:38 +08:00
quota [trivial fix]fix typos in neutron 2017-12-31 06:43:52 +00:00
__init__.py Update License Headers to replace Nicira with VMware 2014-02-27 08:11:15 +00:00
_model_query.py Reorder checks in apply_filters in db/_model_query 2017-11-01 09:44:26 +09:00
_resource_extend.py Refactor CommonDbMixin for removal 2017-04-25 14:13:30 -04:00
_utils.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
address_scope_db.py use neutron-lib address scope apidef 2017-09-20 10:58:12 -06:00
agents_db.py use agent api def from neutron-lib 2017-11-21 12:22:53 -07:00
agentschedulers_db.py use agent api def from neutron-lib 2017-11-21 12:22:53 -07:00
allowedaddresspairs_db.py use addr pairs api def from lib 2017-11-13 11:56:32 -07:00
api.py Cleaned up get_session 2018-01-05 18:39:19 +00:00
common_db_mixin.py Move _get_marker_obj() out of CommonDbMixin. 2017-05-02 16:47:42 +00:00
data_plane_status_db.py Eliminate lookup of "resource extend" funcs by name 2017-04-21 14:48:42 -04:00
db_base_plugin_common.py Switch to Subnet OVO in ipam_backend_mixin _save_subnet method 2018-01-03 12:48:44 +01:00
db_base_plugin_v2.py Merge "Switch to use _get_subnet_object() in ipam_backend_mixin module" 2017-12-20 00:53:36 +00:00
dns_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
dvr_mac_db.py use dvr api def from neutron-lib 2017-11-13 10:27:16 -07:00
external_net_db.py Update network external attribute for RBAC change 2017-12-12 01:24:12 +00:00
extradhcpopt_db.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
extraroute_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
flavors_db.py use flavors api def from neutron-lib 2017-11-17 10:21:28 -07:00
ipam_backend_mixin.py Switch to Subnet OVO in ipam_backend_mixin _save_subnet method 2018-01-03 12:48:44 +01:00
ipam_pluggable_backend.py ipam: don't commit IPAllocation while IpamAllocation is rolled back 2017-12-20 12:40:34 -08:00
l3_agentschedulers_db.py Merge "l3_agentschedulers_db: convert from Agent model to OVO" 2017-12-18 09:01:40 +00:00
l3_attrs_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
l3_db.py Add notification for floatingip update/delete 2018-02-01 11:55:49 -08:00
l3_dvr_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
l3_dvr_ha_scheduler_db.py Remove unused LOG 2016-07-05 15:22:13 +08:00
l3_dvrscheduler_db.py DVR: Fix unbound fip port migration to bound port 2017-10-04 20:52:36 +00:00
l3_fip_qos.py Allow objects to opt in new engine facade 2018-02-09 04:07:34 +00:00
l3_gwmode_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
l3_hamode_db.py l3_ha: only pass host into update_port when updating router port bindings 2018-01-16 14:37:32 -08:00
l3_hascheduler_db.py use service type constants from neutron_lib plugins 2017-06-27 15:16:05 -06:00
models_v2.py Allow to set/modify network mtu 2017-08-11 00:57:34 +00:00
network_ip_availability_db.py Add network ip availability filtered by project_id 2017-08-23 08:53:25 +08:00
portbindings_base.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
portbindings_db.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
portsecurity_db.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
portsecurity_db_common.py use neutron-lib port security api-def 2017-05-01 11:45:42 -06:00
provisioning_blocks.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
quota_db.py Create packages for quota modules 2015-07-28 11:55:01 -07:00
rbac_db_mixin.py Update network external attribute for RBAC change 2017-12-12 01:24:12 +00:00
rbac_db_models.py Bump network rev on RBAC change 2017-08-02 16:44:01 +00:00
securitygroups_db.py create_security_group: Expunge an object selectively 2017-10-18 11:00:03 +09:00
securitygroups_rpc_base.py remove neutron.callbacks package 2018-01-16 09:32:32 -07:00
segments_db.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
servicetype_db.py Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
sqlalchemytypes.py For typo in sqlalchemytypes 2017-02-13 16:18:46 +00:00
standard_attr.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
standardattrdescription_db.py Eliminate lookup of "resource extend" funcs by name 2017-04-21 14:48:42 -04:00
subnet_service_type_db_models.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
tag_db.py Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
vlantransparent_db.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00