From d247ce2a6816ff62dbe765511ae160f48f58f7f7 Mon Sep 17 00:00:00 2001 From: "Oleg A. Ukraintsev" Date: Sat, 24 Feb 2024 10:42:18 +0500 Subject: [PATCH] changed UUID to v4 --- prometheus_zabbix_template_generator/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prometheus_zabbix_template_generator/parser.py b/prometheus_zabbix_template_generator/parser.py index 891c6cd..7aec23d 100644 --- a/prometheus_zabbix_template_generator/parser.py +++ b/prometheus_zabbix_template_generator/parser.py @@ -35,7 +35,7 @@ def __str__(self): def _get_item_definition(self, item_template: dict, name: str, template_uuid: str) -> dict: new_item = copy.deepcopy(item_template) - new_item["uuid"] = str(uuid.uuid5(uuid.NAMESPACE_DNS, name + template_uuid)).replace("-", "") + new_item["uuid"] = str(uuid.uuid4()).replace("-", "") new_item["description"] = self.help new_item["key"] = new_item["key"].replace("PROM2ZABBIX_ITEM_KEY", self.label) new_item["name"] = new_item["name"].replace("PROM2ZABBIX_ITEM_NAME", self.label) @@ -86,7 +86,7 @@ def parse(self): def generate_template(self, name: str | None): file_name = None if name: - template_uuid = str(uuid.uuid5(uuid.NAMESPACE_DNS, name)).replace("-", "") + template_uuid = str(uuid.uuid4()).replace("-", "") file_name = f"{name}.json".replace(" ", "_") else: template_uuid = str(uuid.uuid4()).replace("-", "")