Skip to content

Commit 2af9480

Browse files
committed
Rename --force-kill option to --force in kill action (aiidateam#6908)
`verdi process kill --force-kill` is too redundant so we simplify the command.
1 parent 645d537 commit 2af9480

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/aiida/cmdline/commands/cmd_process.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,14 @@ def process_status(call_link_label, most_recent_node, max_depth, processes):
331331
@options.WAIT()
332332
@OverridableOption(
333333
'-F',
334-
'--force-kill',
334+
'--force',
335335
is_flag=True,
336336
default=False,
337337
help='Kills the process without waiting for a confirmation if the job has been killed.\n'
338338
'Note: This may lead to orphaned jobs on your HPC and should be used with caution.',
339339
)()
340340
@decorators.with_dbenv()
341-
def process_kill(processes, all_entries, timeout, wait, force_kill):
341+
def process_kill(processes, all_entries, timeout, wait, force):
342342
"""Kill running processes.
343343
344344
Kill one or multiple running processes."""
@@ -355,7 +355,7 @@ def process_kill(processes, all_entries, timeout, wait, force_kill):
355355
if all_entries:
356356
click.confirm('Are you sure you want to kill all processes?', abort=True)
357357

358-
if force_kill:
358+
if force:
359359
echo.echo_warning('Force kill is enabled. This may lead to orphaned jobs on your HPC.')
360360
msg_text = 'Force killed through `verdi process kill`'
361361
else:
@@ -365,7 +365,7 @@ def process_kill(processes, all_entries, timeout, wait, force_kill):
365365
control.kill_processes(
366366
processes,
367367
msg_text=msg_text,
368-
force_kill=force_kill,
368+
force=force,
369369
all_entries=all_entries,
370370
timeout=timeout,
371371
wait=wait,

src/aiida/engine/processes/control.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def kill_processes(
173173
processes: list[ProcessNode] | None = None,
174174
*,
175175
msg_text: str = 'Killed through `aiida.engine.processes.control.kill_processes`',
176-
force_kill: bool = False,
176+
force: bool = False,
177177
all_entries: bool = False,
178178
timeout: float = 5.0,
179179
wait: bool = False,
@@ -202,7 +202,7 @@ def kill_processes(
202202
return
203203

204204
controller = get_manager().get_process_controller()
205-
action = functools.partial(controller.kill_process, msg_text=msg_text, force_kill=force_kill)
205+
action = functools.partial(controller.kill_process, msg_text=msg_text, force_kill=force)
206206
_perform_actions(processes, action, 'kill', 'killing', timeout, wait)
207207

208208

0 commit comments

Comments
 (0)