diff --git a/vmware_nsxlib/v3/policy/lb_defs.py b/vmware_nsxlib/v3/policy/lb_defs.py index 2f2d3163..792aa363 100644 --- a/vmware_nsxlib/v3/policy/lb_defs.py +++ b/vmware_nsxlib/v3/policy/lb_defs.py @@ -233,9 +233,11 @@ class LBVirtualServerDef(ResourceDef): value=server_ssl_binding.get_obj_dict()) waf_profile_binding = self.get_attr('waf_profile_binding') if waf_profile_binding: + if isinstance(waf_profile_binding, WAFProfileBindingDef): + waf_profile_binding = waf_profile_binding.get_obj_dict() self._set_attr_if_specified( body, 'waf_profile_binding', - value=waf_profile_binding.get_obj_dict()) + value=waf_profile_binding) rules = self.get_attr('rules') if self.has_attr('rules'): rules = rules if isinstance(rules, list) else [rules] diff --git a/vmware_nsxlib/v3/policy/lb_resources.py b/vmware_nsxlib/v3/policy/lb_resources.py index 46e32157..f2d9dfa3 100644 --- a/vmware_nsxlib/v3/policy/lb_resources.py +++ b/vmware_nsxlib/v3/policy/lb_resources.py @@ -412,7 +412,7 @@ class NsxPolicyLoadBalancerPoolApi(NsxPolicyResourceBase): pool_data.get('active_monitor_paths')) if kwargs.get('algorithm', IGNORE) == IGNORE: - kwargs['algorithm'] = pool_data['algorithm'] + kwargs['algorithm'] = pool_data.get('algorithm') for k in kwargs.keys(): if kwargs.get(k) == IGNORE and pool_data.get(k):