Merge "NSX|V3: Fix router check for LB service"

This commit is contained in:
Zuul 2019-06-11 13:31:04 +00:00 committed by Gerrit Code Review
commit 248744b7c5

View File

@ -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