3 # Copyright (c) 2003 Intel Corporation
6 # Copyright (c) 2004-2006 The Trustees of Princeton University
9 from Exceptions import *
11 import notify_messages
17 UpdateLastBootOnce will update the last_* values for the node only
18 once per boot. This helps calculate last_time_spent_online and
19 last_time_spent_offline for collecting run-time metrics.
22 log.write("\n\nStep: Updating node last boot times at PLC.\n")
26 if not os.path.isfile("/tmp/UPDATE_LAST_BOOT_ONCE"):
27 BootAPI.call_api_function(vars, "BootUpdateNode", (update_vals,) )
28 log.write("Successfully updated boot state for this node at PLC\n")
29 os.system("touch /tmp/UPDATE_LAST_BOOT_ONCE")
30 except BootManagerException as e:
31 log.write("Unable to update last boot times for this node at PLC: {}.\n"