Address network filtering issue

Ensure that network retrieval without id will not cause and
exception.

Change-Id: Icebed0daa658fd50e179eb5c272e12ab9e666353
(cherry picked from commit 4c2c53eb86)
This commit is contained in:
Gary Kotton 2017-05-08 07:37:26 -07:00 committed by garyk
parent f10a3432df
commit b440057ed6
2 changed files with 4 additions and 0 deletions

View File

@ -569,6 +569,8 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
def _extend_network_dict_provider(self, context, network,
multiprovider=None, bindings=None):
if 'id' not in network:
return
if not bindings:
bindings = nsxv_db.get_network_bindings(context.session,
network['id'])

View File

@ -665,6 +665,8 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
bindings[0].binding_type == utils.NsxV3NetworkTypes.VXLAN)
def _extend_network_dict_provider(self, context, network, bindings=None):
if 'id' not in network:
return
if not bindings:
bindings = nsx_db.get_network_bindings(context.session,
network['id'])