Fix SQLAlchemy warnings with view only relationships
The view only relatinships must be specified in the DB model. The following are fixed: - QosNetworkPolicyBinding.port: "port" DB object will have a view only copy of the "network" QoS policy. - Subnet.rbac_entries: "subnet" DB object will have a view only copy of the "network" RBAC policies. Change-Id: I2396c0a23b00439d46faf4b29a082b3819528d89 Closes-Bug: #1927763
This commit is contained in:
parent
235864772d
commit
2321339ee6
neutron/db
@ -230,7 +230,8 @@ class Subnet(standard_attr.HasStandardAttributes, model_base.BASEV2,
|
||||
rbac_entries = orm.relationship(
|
||||
rbac_db_models.NetworkRBAC, lazy='subquery', uselist=True,
|
||||
foreign_keys='Subnet.network_id',
|
||||
primaryjoin='Subnet.network_id==NetworkRBAC.object_id')
|
||||
primaryjoin='Subnet.network_id==NetworkRBAC.object_id',
|
||||
viewonly=True)
|
||||
api_collections = [subnet_def.COLLECTION_NAME]
|
||||
collection_resource_map = {subnet_def.COLLECTION_NAME:
|
||||
subnet_def.RESOURCE_NAME}
|
||||
|
@ -59,8 +59,8 @@ class QosNetworkPolicyBinding(model_base.BASEV2):
|
||||
primaryjoin='QosNetworkPolicyBinding.network_id == Port.network_id',
|
||||
foreign_keys=network_id,
|
||||
backref=sa.orm.backref('qos_network_policy_binding', uselist=False,
|
||||
viewonly=True, lazy='joined'),
|
||||
sync_backref=False)
|
||||
lazy='joined'),
|
||||
sync_backref=False, viewonly=True)
|
||||
|
||||
|
||||
class QosFIPPolicyBinding(model_base.BASEV2):
|
||||
|
Loading…
x
Reference in New Issue
Block a user