Skip to content

Commit 3a5254b

Browse files
handle 0 values
Signed-off-by: Saravanan Raju <saravanan.footloose@gmail.com>
1 parent c1c6e48 commit 3a5254b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cdpy/dw.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ def delete_cluster(self, cluster_id: str, force: bool = False):
100100
def create_vw(self, cluster_id:str, dbc_id:str, vw_type:str, name:str, template:str = None,
101101
autoscaling_min_cluster:int = None, autoscaling_max_cluster:int = None,
102102
service_config_req:str = None, tags:dict = None):
103-
if all(x is not None for x in [autoscaling_min_cluster, autoscaling_max_cluster]):
104-
autoscaling_options = dict(minClusters=autoscaling_min_cluster, maxClusters=autoscaling_max_cluster)
105-
else:
103+
if all(x is None for x in [autoscaling_min_cluster, autoscaling_max_cluster]):
106104
autoscaling_options = None
105+
else:
106+
autoscaling_options = dict(minClusters=None if autoscaling_min_cluster == 0 else autoscaling_min_cluster,
107+
maxClusters=None if autoscaling_max_cluster == 0 else autoscaling_max_cluster)
107108

108109
tag_list = []
109110
for key,value in tags.items():

0 commit comments

Comments
 (0)