postgresql compatibility for get_l3_agent routines
This commit fixes a bug caused by the sqlalchemy group_by statement in the get_l3_agent routines when using postgresql. All select statements need to be replicated in the group_by statement. Change-Id: Ib938be79408d78e0973fed10a68934397341c180 Closes-Bug: #1811873
This commit is contained in:
@@ -96,7 +96,7 @@ class Agent(base.NeutronDbObject):
|
||||
rb_model.RouterL3AgentBinding.router_id
|
||||
).label('count')).outerjoin(
|
||||
rb_model.RouterL3AgentBinding).group_by(
|
||||
agent_model.Agent.id,
|
||||
agent_model.Agent,
|
||||
rb_model.RouterL3AgentBinding
|
||||
.l3_agent_id).order_by('count')
|
||||
res = query.filter(agent_model.Agent.id.in_(agent_ids)).first()
|
||||
@@ -110,7 +110,7 @@ class Agent(base.NeutronDbObject):
|
||||
rb_model.RouterL3AgentBinding.router_id)
|
||||
.label('count')).
|
||||
outerjoin(rb_model.RouterL3AgentBinding).
|
||||
group_by(agent_model.Agent.id).
|
||||
group_by(agent_model.Agent).
|
||||
filter(agent_model.Agent.id.in_(agent_ids)).
|
||||
order_by('count'))
|
||||
agents = [cls._load_object(context, record[0]) for record in query]
|
||||
|
||||
Reference in New Issue
Block a user