X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=blobdiff_plain;f=source%2Fsteps%2FUpdateLastBootOnce.py;h=33dd6cb536d1b8f5878ac8e7f4e64ab9053b6247;hp=5d689ac935c49c9ec1c6f39a6bc0a0ae0dfa5db3;hb=621647f8fad5b114a8bda1557ff1657c3efc7e22;hpb=d4be39e78e9a1a0c1885958e74189280a281be1b diff --git a/source/steps/UpdateLastBootOnce.py b/source/steps/UpdateLastBootOnce.py index 5d689ac..33dd6cb 100644 --- a/source/steps/UpdateLastBootOnce.py +++ b/source/steps/UpdateLastBootOnce.py @@ -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