3 # Copyright (c) 2003 Intel Corporation
6 # Copyright (c) 2004-2006 The Trustees of Princeton University
12 from Exceptions import *
18 Stop the RunlevelAgent.py script. Should proceed
19 kexec to reset run_level to 'boot' before kexec
22 log.write("\n\nStep: Stopping RunlevelAgent.py\n")
25 cmd = "{}/RunlevelAgent.py".format(vars['BM_SOURCE_DIR'])
26 # raise error if script is not present.
28 os.system("/usr/bin/python {} stop".format(cmd))
29 except KeyError as var:
30 raise BootManagerException("Missing variable in vars: {}\n".format(var))
31 except ValueError as var:
32 raise BootManagerException("Variable in vars, shouldn't be: {}\n".format(var))
36 update_vals['run_level'] = 'boot'
37 BootAPI.call_api_function(vars, "ReportRunlevel", (update_vals,))
38 except BootManagerException as e:
39 log.write("Unable to update boot state for this node at PLC: {}.\n".format(e))