11
2- # Copyright (C) 2017-2018 Vanessa Sochat.
2+ # Copyright (C) 2017-2019 Vanessa Sochat.
33
44# This Source Code Form is subject to the terms of the
55# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
66# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
77
88
99from spython .logger import bot
10- import sys
1110
1211def start (self , image = None , name = None , args = None , sudo = False , options = [], capture = False ):
1312 '''start an instance. This is done by default when an instance is created.
@@ -27,8 +26,7 @@ def start(self, image=None, name=None, args=None, sudo=False, options=[], captur
2726
2827 '''
2928 from spython .utils import ( run_command ,
30- check_install ,
31- get_singularity_version )
29+ check_install )
3230 check_install ()
3331
3432 # If no name provided, give it an excellent one!
@@ -41,14 +39,13 @@ def start(self, image=None, name=None, args=None, sudo=False, options=[], captur
4139
4240 # Not having this means it was called as a command, without an image
4341 if not hasattr (self , "_image" ):
44- bot .error ('Please provide an image, or create an Instance first.' )
45- sys .exit (1 )
42+ bot .exit ('Please provide an image, or create an Instance first.' )
4643
4744 image = self ._image
4845
4946 # Derive subgroup command based on singularity version
5047 subgroup = 'instance.start'
51- if 'version 3' in get_singularity_version ():
48+ if 'version 3' in self . version ():
5249 subgroup = ["instance" , "start" ]
5350
5451 cmd = self ._init_command (subgroup )
0 commit comments