TVD: ensure that extra attributs are set for router iif they exist

Validate that the extra attributes are configured.

Change-Id: I45aad02b6b2855653aef37c0cd9dfeaf7e152bde
This commit is contained in:
Gary Kotton 2018-01-31 01:43:23 -08:00 committed by Adit Sarfaty
parent 142927151a
commit aa013353df
2 changed files with 4 additions and 2 deletions

View File

@ -3120,7 +3120,8 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
def _process_extra_attr_router_create(self, context, router_db, r):
for extra_attr in l3_attrs_db.get_attr_info().keys():
if extra_attr in r:
if (extra_attr in r and
validators.is_attr_set(r.get(extra_attr))):
self.set_extra_attr_value(context, router_db,
extra_attr, r[extra_attr])

View File

@ -3262,7 +3262,8 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
def _process_extra_attr_router_create(self, context, router_db, r):
for extra_attr in l3_attrs_db.get_attr_info().keys():
if extra_attr in r:
if (extra_attr in r and
validators.is_attr_set(r.get(extra_attr))):
self.set_extra_attr_value(context, router_db,
extra_attr, r[extra_attr])