From 067e73337fccf4ccbb3799e951ca3dea7b8f3fa7 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 4 Dec 2023 15:48:27 -0500 Subject: [PATCH] Shorten health IDs to 8 characters --- health-daemon/pvchealthd/objects/MonitoringInstance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/health-daemon/pvchealthd/objects/MonitoringInstance.py b/health-daemon/pvchealthd/objects/MonitoringInstance.py index a578aec3..8aafe1d2 100644 --- a/health-daemon/pvchealthd/objects/MonitoringInstance.py +++ b/health-daemon/pvchealthd/objects/MonitoringInstance.py @@ -528,7 +528,7 @@ class MonitoringInstance(object): def generate_fault(self, fault_name, fault_time, fault_delta, fault_message): # Generate a fault ID from the fault_message and fault_delta fault_str = f"{fault_name} {fault_delta} {fault_message}" - fault_id = str(md5(fault_str.encode("utf-8")).hexdigest()) + fault_id = str(md5(fault_str.encode("utf-8")).hexdigest())[:8] # If a fault already exists with this ID, just update the time if not self.zkhandler.exists("base.faults"):