done prettifying
[bootmanager.git] / source / steps / UpdateLastBootOnce.py
index 5d689ac..33dd6cb 100644 (file)
@@ -12,22 +12,22 @@ import notify_messages
 import os.path
 
 
-def Run( vars, log ):
+def Run(vars, log):
     """
-        UpdateLastBootOnce will update the last_* values for the node only
-        once per boot.  This helps calculate last_time_spent_online and
-        last_time_spent_offline for collecting run-time metrics.
+    UpdateLastBootOnce will update the last_* values for the node only
+    once per boot.  This helps calculate last_time_spent_online and
+    last_time_spent_offline for collecting run-time metrics.
     """
 
-    log.write( "\n\nStep: Updating node last boot times at PLC.\n" )
+    log.write("\n\nStep: Updating node last boot times at PLC.\n")
 
-    update_vals= {}
+    update_vals = {}
     try:
         if not os.path.isfile("/tmp/UPDATE_LAST_BOOT_ONCE"):
-            BootAPI.call_api_function( vars, "BootUpdateNode", (update_vals,) )
-            log.write( "Successfully updated boot state for this node at PLC\n" )
+            BootAPI.call_api_function(vars, "BootUpdateNode", (update_vals,) )
+            log.write("Successfully updated boot state for this node at PLC\n")
             os.system("touch /tmp/UPDATE_LAST_BOOT_ONCE")
-    except BootManagerException, e:
-        log.write( "Unable to update last boot times for this node at PLC: %s.\n" % e )
-
+    except BootManagerException as e:
+        log.write("Unable to update last boot times for this node at PLC: {}.\n"
+                  .format(e))
     return 1