3 # Copyright (c) 2003 Intel Corporation
6 # Copyright (c) 2004-2006 The Trustees of Princeton University
9 from Exceptions import *
11 import notify_messages
16 Change this nodes boot state at PLC.
18 The current value of the BOOT_STATE key in vars is used.
19 Optionally, notify the contacts of the boot state change.
20 If this is the case, the following keys/values
21 should be set in vars before calling this step:
22 STATE_CHANGE_NOTIFY= 1
23 STATE_CHANGE_NOTIFY_MESSAGE= "<notify message>"
24 The second value is a message to send the users from notify_messages.py
26 Return 1 if succesfull, a BootManagerException otherwise.
29 log.write( "\n\nStep: Updating node boot state at PLC.\n" )
32 update_vals['boot_state']= vars['BOOT_STATE']
34 BootAPI.call_api_function( vars, "BootUpdateNode", (update_vals,) )
35 log.write( "Successfully updated boot state for this node at PLC\n" )
36 except BootManagerException, e:
37 log.write( "Unable to update boot state for this node at PLC: %s.\n" % e )
39 notify = vars.get("STATE_CHANGE_NOTIFY",0)
42 message= vars['STATE_CHANGE_NOTIFY_MESSAGE']
49 sent= BootAPI.call_api_function( vars, "BootNotifyOwners",
54 except BootManagerException, e:
55 log.write( "Call to BootNotifyOwners failed: %s.\n" % e )
58 log.write( "Unable to notify site contacts of state change.\n" )