From fa5eb530bb71c1b1fe1020802a63b05907695011 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Wed, 16 Mar 2016 01:35:26 -0700 Subject: [PATCH] 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 691f8f5ea54c04bfdfb76e25bda14665b05ed859) --- neutron/db/models_v2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/db/models_v2.py b/neutron/db/models_v2.py index 7780c71e4f8..8a05ead1269 100644 --- a/neutron/db/models_v2.py +++ b/neutron/db/models_v2.py @@ -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')