Skip to content

Commit 835d6ac

Browse files
authored
update scalingAction.sh to work with python 3.9.4 (#2317)
1 parent b2a530a commit 835d6ac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

operator/scripts/scaling/scalingAction.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ for i in json.load(sys.stdin)["items"]:
178178
for index, cs in enumerate(j):
179179
if j[index]["clusterName"] == "$wls_cluster_name":
180180
outer_loop_must_break = True
181-
print True
181+
print (True)
182182
break
183183
if outer_loop_must_break == False:
184-
print False
184+
print (False)
185185
INPUT
186186
in_cluster_startup=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}`
187187
fi
@@ -204,7 +204,7 @@ for i in json.load(sys.stdin)["items"]:
204204
j = i["spec"]["clusters"]
205205
for index, cs in enumerate(j):
206206
if j[index]["clusterName"] == "$wls_cluster_name":
207-
print j[index]["replicas"]
207+
print (j[index]["replicas"])
208208
INPUT
209209
num_ms=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}`
210210
fi
@@ -228,7 +228,7 @@ function get_num_ms_domain_scope() {
228228
cat > cmds-$$.py << INPUT
229229
import sys, json
230230
for i in json.load(sys.stdin)["items"]:
231-
print i["spec"]["replicas"]
231+
print (i["spec"]["replicas"])
232232
INPUT
233233
num_ms=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}`
234234
fi
@@ -264,7 +264,7 @@ for i in json.load(sys.stdin)["items"]:
264264
j = i["status"]["clusters"]
265265
for index, cs in enumerate(j):
266266
if j[index]["clusterName"] == "$clusterName":
267-
print j[index]["minimumReplicas"]
267+
print (j[index]["minimumReplicas"])
268268
INPUT
269269
minReplicas=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}`
270270
fi
@@ -291,7 +291,7 @@ function get_replica_count() {
291291
fi
292292

293293
get_min_replicas "${DOMAIN}" "${wls_cluster_name}" minReplicas
294-
if [ "${num_ms}" -lt "${minReplicas}" ]; then
294+
if [[ "${num_ms}" -lt "${minReplicas}" ]]; then
295295
# Reset managed server count to minimum replicas
296296
num_ms=${minReplicas}
297297
fi

0 commit comments

Comments
 (0)