From d1e34e7333a114cba94449f6859af5b5ab568a7c Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 6 Dec 2023 13:20:18 -0500 Subject: [PATCH] Store fault times only to the second Any more precision is unnecessary and saves 6 chars when displaying these times elsewhere. --- daemon-common/faults.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon-common/faults.py b/daemon-common/faults.py index 05f17794..140ce39a 100644 --- a/daemon-common/faults.py +++ b/daemon-common/faults.py @@ -67,8 +67,8 @@ def generate_fault( zkhandler.write( [ (("faults.id", fault_id), ""), - (("faults.first_time", fault_id), str(fault_time)), - (("faults.last_time", fault_id), str(fault_time)), + (("faults.first_time", fault_id), str(fault_time).split(".")[0]), + (("faults.last_time", fault_id), str(fault_time).split(".")[0]), (("faults.ack_time", fault_id), ""), (("faults.status", fault_id), "new"), (("faults.delta", fault_id), fault_delta), @@ -163,7 +163,7 @@ def acknowledge(zkhandler, fault_id): zkhandler.write( [ - (("faults.ack_time", fault_id), datetime.now()), + (("faults.ack_time", fault_id), str(datetime.now()).split(".")[0]), (("faults.status", fault_id), "ack"), ] )