Skip to content

Commit f3d69c9

Browse files
committed
Delegated default timeout to singularity
1 parent 276768b commit f3d69c9

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

spython/instance/cmd/stop.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
from spython.logger import bot
99

1010

11-
def stop(self, name=None, sudo=False, timeout=10):
11+
def stop(self, name=None, sudo=False, timeout=None):
1212
"""stop an instance. This is done by default when an instance is created.
1313
1414
Parameters
1515
==========
1616
name: a name for the instance
1717
sudo: if the user wants to run the command with sudo
18-
timeout: forcebly kill non-stopped instance after specified timeout
19-
in seconds (default 10)
18+
timeout: forcebly kill non-stopped instance after the
19+
timeout specified in seconds
2020
2121
USAGE:
2222
singularity [...] instance.stop [...] <instance name>
@@ -29,7 +29,10 @@ def stop(self, name=None, sudo=False, timeout=10):
2929
subgroup = "instance.stop"
3030

3131
if "version 3" in self.version():
32-
subgroup = ["instance", "stop", "-t", str(timeout)]
32+
subgroup = ["instance", "stop"]
33+
34+
if timeout:
35+
subgroup += ["-t", str(timeout)]
3336

3437
cmd = self._init_command(subgroup)
3538

0 commit comments

Comments
 (0)