Skip to content

Commit 779b632

Browse files
committed
services/kill.py: optionally add boolean value flag in kill cmd
For example, value of "--preserve-queues" is boolean in /kill request schema. If it's true, add it to the kill cmd, otherwise don't add the flag. Signed-off-by: Vallari Agrawal <[email protected]>
1 parent f246efa commit 779b632

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/teuthology_api/services/kill.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ async def run(args, send_logs: bool, token: dict, request: Request):
5252
try:
5353
kill_cmd = [f"{TEUTHOLOGY_PATH}/virtualenv/bin/teuthology-kill"]
5454
for flag, flag_value in args.items():
55-
if isinstance(flag_value, bool):
56-
flag_value = int(flag_value)
57-
kill_cmd += [flag, str(flag_value)]
55+
if isinstance(flag_value, bool): # check for --preserve-queues
56+
if flag_value == True:
57+
kill_cmd += [flag]
58+
else:
59+
kill_cmd += [flag, str(flag_value)]
5860
log.info(kill_cmd)
5961
proc = subprocess.Popen(
6062
kill_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT

0 commit comments

Comments
 (0)