Add uselist=True to subnet rbac_entries relationship

Because the join conditions for Subnet rbac entries
are manually specified, SQLAlchemy is not
automatically detecting that this relationship is a list.
This adds the uselist=True kwarg to the relationship to
ensure that it's always handled as a list.

Change-Id: Ia4ae57ddd932260691584ae74c0305a79b2e60a9
Closes-Bug: #1557959
(cherry picked from commit 691f8f5ea5)
This commit is contained in:
Kevin Benton 2016-03-16 01:35:26 -07:00
parent 80c320bb29
commit fa5eb530bb
1 changed files with 1 additions and 1 deletions

View File

@ -220,7 +220,7 @@ class Subnet(model_base.HasStandardAttributes, model_base.BASEV2,
# subnets don't have their own rbac_entries, they just inherit from
# the network rbac entries
rbac_entries = orm.relationship(
rbac_db_models.NetworkRBAC, lazy='joined',
rbac_db_models.NetworkRBAC, lazy='joined', uselist=True,
foreign_keys='Subnet.network_id',
primaryjoin='Subnet.network_id==NetworkRBAC.object_id')