NSXv: Fix failure in lbaas edge selection

When LBaaS attempts to find an Edge which can host a loadbalancer,
it fails when a network is attached to a VDR, since VDRs have no
router_type attribute.

Change-Id: Ib54728158d438fc0284756d20e8e5e28ddd60986
This commit is contained in:
Kobi Samoray 2016-07-07 15:45:53 +03:00
parent 75735f559d
commit 1f8c1d6e3b
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ def get_lbaas_edge_id_for_subnet(context, plugin, subnet_id, tenant_id):
for attached_router in attached_routers:
router = plugin.get_router(context, attached_router['device_id'])
if router['router_type'] == 'exclusive':
if router.get('router_type') == 'exclusive':
rtr_bindings = nsxv_db.get_nsxv_router_binding(context.session,
router['id'])
return rtr_bindings['edge_id']