@@ -60,8 +60,8 @@ def configure_load_balancer_profile(managed_outbound_ip_count, managed_outbound_
60
60
outbound_ip_prefixes , outbound_ports , idle_timeout ,
61
61
backend_pool_type , profile , models ):
62
62
"""configure a load balancer with customer supplied values"""
63
- if any ([managed_outbound_ip_count ,
64
- managed_outbound_ipv6_count ,
63
+ if any ([managed_outbound_ip_count is not None ,
64
+ managed_outbound_ipv6_count is not None ,
65
65
outbound_ips ,
66
66
outbound_ip_prefixes ]):
67
67
outbound_ip_resources = _get_load_balancer_outbound_ips (outbound_ips , models )
@@ -93,7 +93,7 @@ def configure_load_balancer_profile(managed_outbound_ip_count, managed_outbound_
93
93
)
94
94
elif profile .outbound_ip_prefixes is not None :
95
95
profile .outbound_ip_prefixes = None
96
- if managed_outbound_ip_count or managed_outbound_ipv6_count :
96
+ if managed_outbound_ip_count is not None or managed_outbound_ipv6_count is not None :
97
97
if profile .managed_outbound_i_ps is None :
98
98
if isinstance (models , SimpleNamespace ):
99
99
ManagedClusterLoadBalancerProfileManagedOutboundIPs = (
@@ -104,13 +104,13 @@ def configure_load_balancer_profile(managed_outbound_ip_count, managed_outbound_
104
104
"ManagedClusterLoadBalancerProfileManagedOutboundIPs"
105
105
)
106
106
profile .managed_outbound_i_ps = ManagedClusterLoadBalancerProfileManagedOutboundIPs ()
107
- if managed_outbound_ip_count :
107
+ if managed_outbound_ip_count is not None :
108
108
profile .managed_outbound_i_ps .count = managed_outbound_ip_count
109
- if managed_outbound_ipv6_count :
109
+ if managed_outbound_ipv6_count is not None :
110
110
profile .managed_outbound_i_ps .count_ipv6 = managed_outbound_ipv6_count
111
111
elif profile .managed_outbound_i_ps is not None :
112
112
profile .managed_outbound_i_ps = None
113
- if outbound_ports :
113
+ if outbound_ports is not None :
114
114
profile .allocated_outbound_ports = outbound_ports
115
115
if idle_timeout :
116
116
profile .idle_timeout_in_minutes = idle_timeout
@@ -121,11 +121,11 @@ def configure_load_balancer_profile(managed_outbound_ip_count, managed_outbound_
121
121
122
122
def is_load_balancer_profile_provided (managed_outbound_ip_count , managed_outbound_ipv6_count , outbound_ips , ip_prefixes ,
123
123
outbound_ports , backend_pool_type , idle_timeout ):
124
- return any ([managed_outbound_ip_count ,
125
- managed_outbound_ipv6_count ,
124
+ return any ([managed_outbound_ip_count is not None ,
125
+ managed_outbound_ipv6_count is not None ,
126
126
outbound_ips ,
127
127
ip_prefixes ,
128
- outbound_ports ,
128
+ outbound_ports is not None ,
129
129
idle_timeout ,
130
130
backend_pool_type ])
131
131
0 commit comments