Skip to content

Commit 92ef499

Browse files
committed
Allow scaling script to work consistently with Python 2 and 3
1 parent 88d956d commit 92ef499

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

operator/scripts/scaling/scalingAction.sh

100755100644
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ cat > cmds-$$.py << INPUT
9898
import sys, json
9999
for i in json.load(sys.stdin)["spec"]["ports"]:
100100
if i["name"] == "rest":
101-
print(i["port"])
101+
print((i["port"]))
102102
INPUT
103103
port=$(echo "${STATUS}" | python cmds-$$.py 2>> ${log_file_name})
104104
fi
@@ -131,7 +131,7 @@ cat > cmds-$$.py << INPUT
131131
import sys, json
132132
for i in json.load(sys.stdin)["groups"]:
133133
if i["name"] == "weblogic.oracle":
134-
print(i["preferredVersion"]["version"])
134+
print((i["preferredVersion"]["version"]))
135135
INPUT
136136
domain_api_version=`echo ${APIS} | python cmds-$$.py 2>> ${log_file_name}`
137137
fi
@@ -196,7 +196,7 @@ cat > cmds-$$.py << INPUT
196196
import sys, json
197197
for j in json.load(sys.stdin)["spec"]["clusters"]:
198198
if j["clusterName"] == "$wls_cluster_name":
199-
print (j["replicas"])
199+
print((j["replicas"]))
200200
INPUT
201201
num_ms=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}`
202202
fi
@@ -219,7 +219,7 @@ function get_num_ms_domain_scope() {
219219
else
220220
cat > cmds-$$.py << INPUT
221221
import sys, json
222-
print (json.load(sys.stdin)["spec"]["replicas"])
222+
print((json.load(sys.stdin)["spec"]["replicas"]))
223223
INPUT
224224
num_ms=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}`
225225
fi
@@ -253,7 +253,7 @@ cat > cmds-$$.py << INPUT
253253
import sys, json
254254
for j in json.load(sys.stdin)["status"]["clusters"]:
255255
if j["clusterName"] == "$clusterName":
256-
print (j["minimumReplicas"])
256+
print((j["minimumReplicas"]))
257257
INPUT
258258
minReplicas=`echo ${DOMAIN} | python cmds-$$.py 2>> ${log_file_name}`
259259
fi

0 commit comments

Comments
 (0)