NSXv: validate that router is not None
Check that the value returned is not None and then check the type Change-Id: Ib95f18d329de8c46ce5a5547b7b4dab459d3f419 Fixes-Bug: #1500037
This commit is contained in:
parent
b9a69d335a
commit
fe5acd6213
@ -241,7 +241,7 @@ class RouterSharedDriver(router_driver.RouterBaseDriver):
|
||||
nsx_attr = (context.session.query(
|
||||
nsxv_models.NsxvRouterExtAttributes).filter_by(
|
||||
router_id=r['id']).first())
|
||||
if nsx_attr['router_type'] == 'shared':
|
||||
if nsx_attr and nsx_attr['router_type'] == 'shared':
|
||||
shared_routers.append(r)
|
||||
return shared_routers
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user