Browse Source

Merge "Do not use None values on patch partial update calls"

changes/99/681199/5
Zuul 1 month ago
parent
commit
63d8c2228c
2 changed files with 13 additions and 13 deletions
  1. 10
    10
      vmware_nsxlib/v3/policy/core_defs.py
  2. 3
    3
      vmware_nsxlib/v3/policy/lb_defs.py

+ 10
- 10
vmware_nsxlib/v3/policy/core_defs.py View File

@@ -306,7 +306,7 @@ class RouterDef(ResourceDef):
306 306
         # Add dhcp relay config
307 307
         # TODO(asarfaty): this can be either dhcp or dhcp relay config
308 308
         if self.has_attr('dhcp_config'):
309
-            paths = None
309
+            paths = ""
310 310
             if self.get_attr('dhcp_config'):
311 311
                 dhcp_conf = DhcpRelayConfigDef(
312 312
                     config_id=self.get_attr('dhcp_config'),
@@ -317,7 +317,7 @@ class RouterDef(ResourceDef):
317 317
                                         value=paths)
318 318
 
319 319
         if self.has_attr('ipv6_ndra_profile_id'):
320
-            paths = None
320
+            paths = ""
321 321
             if self.get_attr('ipv6_ndra_profile_id'):
322 322
                 ndra_profile = Ipv6NdraProfileDef(
323 323
                     profile_id=self.get_attr('ipv6_ndra_profile_id'),
@@ -490,7 +490,7 @@ class Tier1InterfaceDef(ResourceDef):
490 490
                                         value=path)
491 491
 
492 492
         if self.has_attr('ipv6_ndra_profile_id'):
493
-            paths = None
493
+            paths = ""
494 494
             if self.get_attr('ipv6_ndra_profile_id'):
495 495
                 ndra_profile = Ipv6NdraProfileDef(
496 496
                     profile_id=self.get_attr('ipv6_ndra_profile_id'),
@@ -828,7 +828,7 @@ class SegmentSecProfilesBindingMapDef(SegmentBindingMapDefBase):
828 828
         body = super(SegmentSecProfilesBindingMapDef, self).get_obj_dict()
829 829
 
830 830
         if self.has_attr('segment_security_profile_id'):
831
-            path = None
831
+            path = ""
832 832
             if self.get_attr('segment_security_profile_id'):
833 833
                 profile = SegmentSecurityProfileDef(
834 834
                     profile_id=self.get_attr('segment_security_profile_id'),
@@ -840,7 +840,7 @@ class SegmentSecProfilesBindingMapDef(SegmentBindingMapDefBase):
840 840
                 value=path)
841 841
 
842 842
         if self.has_attr('spoofguard_profile_id'):
843
-            path = None
843
+            path = ""
844 844
             if self.get_attr('spoofguard_profile_id'):
845 845
                 profile = SpoofguardProfileDef(
846 846
                     profile_id=self.get_attr('spoofguard_profile_id'),
@@ -878,7 +878,7 @@ class SegmentPortSecProfilesBindingMapDef(SegmentPortBindingMapDefBase):
878 878
         body = super(SegmentPortSecProfilesBindingMapDef, self).get_obj_dict()
879 879
 
880 880
         if self.has_attr('segment_security_profile_id'):
881
-            path = None
881
+            path = ""
882 882
             if self.get_attr('segment_security_profile_id'):
883 883
                 profile = SegmentSecurityProfileDef(
884 884
                     profile_id=self.get_attr('segment_security_profile_id'),
@@ -890,7 +890,7 @@ class SegmentPortSecProfilesBindingMapDef(SegmentPortBindingMapDefBase):
890 890
                 value=path)
891 891
 
892 892
         if self.has_attr('spoofguard_profile_id'):
893
-            path = None
893
+            path = ""
894 894
             if self.get_attr('spoofguard_profile_id'):
895 895
                 profile = SpoofguardProfileDef(
896 896
                     profile_id=self.get_attr('spoofguard_profile_id'),
@@ -919,7 +919,7 @@ class SegmentPortDiscoveryProfilesBindingMapDef(SegmentPortBindingMapDefBase):
919 919
                      self).get_obj_dict()
920 920
 
921 921
         if self.has_attr('mac_discovery_profile_id'):
922
-            path = None
922
+            path = ""
923 923
             if self.get_attr('mac_discovery_profile_id'):
924 924
                 profile = MacDiscoveryProfileDef(
925 925
                     profile_id=self.get_attr('mac_discovery_profile_id'),
@@ -931,7 +931,7 @@ class SegmentPortDiscoveryProfilesBindingMapDef(SegmentPortBindingMapDefBase):
931 931
                 value=path)
932 932
 
933 933
         if self.has_attr('ip_discovery_profile_id'):
934
-            path = None
934
+            path = ""
935 935
             if self.get_attr('ip_discovery_profile_id'):
936 936
                 profile = IpDiscoveryProfileDef(
937 937
                     profile_id=self.get_attr('ip_discovery_profile_id'),
@@ -960,7 +960,7 @@ class SegmentPortQoSProfilesBindingMapDef(SegmentPortBindingMapDefBase):
960 960
                      self).get_obj_dict()
961 961
 
962 962
         if self.has_attr('qos_profile_id'):
963
-            path = None
963
+            path = ""
964 964
             if self.get_attr('qos_profile_id'):
965 965
                 profile = QosProfileDef(
966 966
                     profile_id=self.get_attr('qos_profile_id'),

+ 3
- 3
vmware_nsxlib/v3/policy/lb_defs.py View File

@@ -263,7 +263,7 @@ class LBVirtualServerDef(ResourceDef):
263 263
                 app_profile_def.get_resource_full_path())
264 264
 
265 265
         if self.has_attr('lb_persistence_profile_id'):
266
-            path = None
266
+            path = ""
267 267
             lb_persistence_profile_id = self.get_attr(
268 268
                 'lb_persistence_profile_id')
269 269
             if lb_persistence_profile_id:
@@ -273,7 +273,7 @@ class LBVirtualServerDef(ResourceDef):
273 273
                 path = lb_persistence_profile_def.get_resource_full_path()
274 274
             body['lb_persistence_profile_path'] = path
275 275
         if self.has_attr('lb_service_id'):
276
-            path = None
276
+            path = ""
277 277
             lb_service_id = self.get_attr('lb_service_id')
278 278
             if lb_service_id:
279 279
                 lb_service_def = LBServiceDef(
@@ -281,7 +281,7 @@ class LBVirtualServerDef(ResourceDef):
281 281
                 path = lb_service_def.get_resource_full_path()
282 282
             body['lb_service_path'] = path
283 283
         if self.has_attr('pool_id'):
284
-            path = None
284
+            path = ""
285 285
             lb_pool_id = self.get_attr('pool_id')
286 286
             if lb_pool_id:
287 287
                 lb_pool_def = LBPoolDef(

Loading…
Cancel
Save