NSX|V3: Fix router check for LB service
A neutron router can be attached to multiple loadbalancers. So the DB query to check if it has any loadbalancers should epect more than one result. Change-Id: I5a2aab53cd1e925f8e75d98cb15b979e1cf88c57
This commit is contained in:
parent
8d7b24f9b6
commit
77aa1ce80c
@ -587,9 +587,9 @@ def get_nsx_lbaas_loadbalancer_binding_by_service(session, lb_service_id):
|
||||
|
||||
def has_nsx_lbaas_loadbalancer_binding_by_router(session, nsx_router_id):
|
||||
try:
|
||||
session.query(nsx_models.NsxLbaasLoadbalancer).filter_by(
|
||||
lb_router_id=nsx_router_id).one()
|
||||
return True
|
||||
bindings = session.query(nsx_models.NsxLbaasLoadbalancer).filter_by(
|
||||
lb_router_id=nsx_router_id).all()
|
||||
return len(bindings) > 0
|
||||
except exc.NoResultFound:
|
||||
return False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user