1 from Exceptions import *
8 Change this nodes boot state at PLC.
10 The current value of the BOOT_STATE key in vars is used.
11 Optionally, notify the contacts of the boot state change.
12 If this is the case, the following keys/values
13 should be set in vars before calling this step:
14 STATE_CHANGE_NOTIFY= 1
15 STATE_CHANGE_NOTIFY_MESSAGE= "<notify message>"
16 The second value is a message to send the users from notify_messages.py
18 Return 1 if succesfull, a BootManagerException otherwise.
21 log.write( "\n\nStep: Updating node boot state at PLC.\n" )
24 update_vals['boot_state']= vars['BOOT_STATE']
25 BootAPI.call_api_function( vars, "BootUpdateNode", (update_vals,) )
27 log.write( "Successfully updated boot state for this node at PLC\n" )
30 if "STATE_CHANGE_NOTIFY" in vars.keys():
31 if vars["STATE_CHANGE_NOTIFY"] == 1:
32 message= vars['STATE_CHANGE_NOTIFY_MESSAGE']
39 sent= BootAPI.call_api_function( vars, "BootNotifyOwners",
44 except BootManagerException, e:
45 log.write( "Call to BootNotifyOwners failed: %s.\n" % e )
48 log.write( "Unable to notify site contacts of state change.\n" )