NSX|P: Do not set None description on resource partial updates

Change-Id: I7bb4299564d82c28357b15335ae786bfa7f0e76b
This commit is contained in:
Adit Sarfaty 2019-09-04 10:26:16 +03:00
parent 7d10e5a595
commit caacf33807
1 changed files with 5 additions and 5 deletions

View File

@ -855,7 +855,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
self.nsxpolicy.segment.update( self.nsxpolicy.segment.update(
network_id, network_id,
name=net_name, name=net_name,
description=net_data.get('description')) description=updated_net.get('description', ''))
except nsx_lib_exc.ManagerError: except nsx_lib_exc.ManagerError:
LOG.exception("Unable to update NSX backend, rolling " LOG.exception("Unable to update NSX backend, rolling "
"back changes on neutron") "back changes on neutron")
@ -1054,7 +1054,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
self.nsxpolicy.segment_port.create_or_overwrite( self.nsxpolicy.segment_port.create_or_overwrite(
name, segment_id, name, segment_id,
port_id=port_data['id'], port_id=port_data['id'],
description=port_data.get('description'), description=port_data.get('description', ''),
address_bindings=address_bindings, address_bindings=address_bindings,
vif_id=vif_id, vif_id=vif_id,
tags=tags) tags=tags)
@ -1839,7 +1839,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
router_id) router_id)
self.nsxpolicy.tier1.update( self.nsxpolicy.tier1.update(
router_id, name=router_name, router_id, name=router_name,
description=updated_router.get('description')) description=updated_router.get('description', ''))
# Updating static routes # Updating static routes
self._delete_static_routes(router_id, routes_removed) self._delete_static_routes(router_id, routes_removed)
removed_routes = True removed_routes = True
@ -2736,11 +2736,11 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
self.nsxpolicy.group.update( self.nsxpolicy.group.update(
domain_id, sg_id, domain_id, sg_id,
name=nsx_name, name=nsx_name,
description=secgroup_res.get('description')) description=secgroup_res.get('description', ''))
self.nsxpolicy.comm_map.update( self.nsxpolicy.comm_map.update(
domain_id, sg_id, domain_id, sg_id,
name=nsx_name, name=nsx_name,
description=secgroup_res.get('description')) description=secgroup_res.get('description', ''))
except Exception as e: except Exception as e:
LOG.warning("Failed to update SG %s NSX resources: %s", LOG.warning("Failed to update SG %s NSX resources: %s",
sg_id, e) sg_id, e)