Skip to content

Commit 593877a

Browse files
authored
Merge pull request #18 from jaydesl/add-terraform-handler
Improve scaling limiter and naming
2 parents 33aeca8 + 97506b4 commit 593877a

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

handle_terraform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def _add_nodes(nodes, variance):
209209
Scale up by adding node(s) to the infrastructure
210210
"""
211211
if not nodes:
212-
nodes.append("0")
212+
nodes.append("1")
213213
variance -= 1
214214
for _ in range(variance):
215215
node_name = str(int(nodes[-1])+1)

pk_helper.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
2-
3-
41
def limit_instances(count,cmin,cmax):
5-
cmin = 1 if not cmin else int(cmin)
6-
cmax = cmin if not cmax else max(int(cmax),cmin)
7-
count = max(min(int(count),cmax),cmin) if count else cmin
8-
return count,cmin,cmax
9-
2+
cmin = 1 if cmin is None else int(cmin)
3+
cmax = cmin if cmax is None else max(int(cmax),cmin)
4+
count = cmin if count is None else max(min(int(count),cmax),cmin)
5+
return count,cmin,cmax

0 commit comments

Comments
 (0)