fix make sync for the current state of the test infra
[bootmanager.git] / source / steps / UpdateBootStateWithPLC.py
index 001dcd9..9271322 100644 (file)
@@ -1,5 +1,5 @@
-#!/usr/bin/python2 -u
-
+#!/usr/bin/python
+#
 # Copyright (c) 2003 Intel Corporation
 # All rights reserved.
 #
@@ -15,6 +15,10 @@ def Run( vars, log ):
     """
     Change this nodes boot state at PLC.
 
+    The only valid transition is from reinstall to boot.  All other changes to
+    the boot state of a node should be performed by the Admin, Tech or PI
+    through the API or Web interface.
+
     The current value of the BOOT_STATE key in vars is used.
     Optionally, notify the contacts of the boot state change.
     If this is the case, the following keys/values
@@ -30,10 +34,11 @@ def Run( vars, log ):
 
     update_vals= {}
     update_vals['boot_state']= vars['BOOT_STATE']
-    BootAPI.call_api_function( vars, "BootUpdateNode", (update_vals,) )
-
-    log.write( "Successfully updated boot state for this node at PLC\n" )
-
+    try:
+        BootAPI.call_api_function( vars, "BootUpdateNode", (update_vals,) )
+        log.write( "Successfully updated boot state for this node at PLC\n" )
+    except BootManagerException, e:
+        log.write( "Unable to update boot state for this node at PLC: %s.\n" % e )
 
     notify = vars.get("STATE_CHANGE_NOTIFY",0)