Browse Source

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

Change-Id: I7bb4299564d82c28357b15335ae786bfa7f0e76b
changes/26/679926/1
Adit Sarfaty 2 weeks ago
parent
commit
caacf33807
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      vmware_nsx/plugins/nsx_p/plugin.py

+ 5
- 5
vmware_nsx/plugins/nsx_p/plugin.py View File

@@ -855,7 +855,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
855 855
                 self.nsxpolicy.segment.update(
856 856
                     network_id,
857 857
                     name=net_name,
858
-                    description=net_data.get('description'))
858
+                    description=updated_net.get('description', ''))
859 859
             except nsx_lib_exc.ManagerError:
860 860
                 LOG.exception("Unable to update NSX backend, rolling "
861 861
                               "back changes on neutron")
@@ -1054,7 +1054,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
1054 1054
         self.nsxpolicy.segment_port.create_or_overwrite(
1055 1055
             name, segment_id,
1056 1056
             port_id=port_data['id'],
1057
-            description=port_data.get('description'),
1057
+            description=port_data.get('description', ''),
1058 1058
             address_bindings=address_bindings,
1059 1059
             vif_id=vif_id,
1060 1060
             tags=tags)
@@ -1839,7 +1839,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
1839 1839
                     router_id)
1840 1840
                 self.nsxpolicy.tier1.update(
1841 1841
                     router_id, name=router_name,
1842
-                    description=updated_router.get('description'))
1842
+                    description=updated_router.get('description', ''))
1843 1843
             # Updating static routes
1844 1844
             self._delete_static_routes(router_id, routes_removed)
1845 1845
             removed_routes = True
@@ -2736,11 +2736,11 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
2736 2736
                 self.nsxpolicy.group.update(
2737 2737
                     domain_id, sg_id,
2738 2738
                     name=nsx_name,
2739
-                    description=secgroup_res.get('description'))
2739
+                    description=secgroup_res.get('description', ''))
2740 2740
                 self.nsxpolicy.comm_map.update(
2741 2741
                     domain_id, sg_id,
2742 2742
                     name=nsx_name,
2743
-                    description=secgroup_res.get('description'))
2743
+                    description=secgroup_res.get('description', ''))
2744 2744
             except Exception as e:
2745 2745
                 LOG.warning("Failed to update SG %s NSX resources: %s",
2746 2746
                             sg_id, e)

Loading…
Cancel
Save