X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2Fsteps%2FStartRunlevelAgent.py;h=8343c4e65534c7c80489433e68b399288ab5febd;hb=885b014c1daa6b055a7d2b435126b4263572b599;hp=f387bf8abb8c5391eacb412d4ddb62ae898fc72b;hpb=1136f7d3b68de92034e188e30863a565d738ea52;p=bootmanager.git diff --git a/source/steps/StartRunlevelAgent.py b/source/steps/StartRunlevelAgent.py index f387bf8..8343c4e 100644 --- a/source/steps/StartRunlevelAgent.py +++ b/source/steps/StartRunlevelAgent.py @@ -1,7 +1,4 @@ -#!/usr/bin/python -# -# $Id$ -# $URL$ +#!/usr/bin/python2 # # Copyright (c) 2003 Intel Corporation # All rights reserved. @@ -15,26 +12,25 @@ import os from Exceptions import * import BootAPI - -def Run( vars, log ): +def Run(vars, log): """ Start the RunlevelAgent.py script. Should follow AuthenticateWithPLC() in order to guarantee that /etc/planetlab/session is present. """ - log.write( "\n\nStep: Starting RunlevelAgent.py\n" ) + log.write("\n\nStep: Starting RunlevelAgent.py\n") try: - cmd = "%s/monitor-runlevelagent" % vars['BM_SOURCE_DIR'] + cmd = "{}/RunlevelAgent.py".format(vars['BM_SOURCE_DIR']) # raise error if script is not present. os.stat(cmd) # init script only starts RLA once. - os.system("/bin/sh %s start bootmanager" % cmd) - except KeyError, var: - raise BootManagerException, "Missing variable in vars: %s\n" % var - except ValueError, var: - raise BootManagerException, "Variable in vars, shouldn't be: %s\n" % var + os.system("/usr/bin/python2 {} start bootmanager &".format(cmd)) + except KeyError as var: + raise BootManagerException("Missing variable in vars: {}\n".format(var)) + except ValueError as var: + raise BootManagerException("Variable in vars, shouldn't be: {}\n".format(var)) return 1