From 06f97b132a1be0a409072adb274005bfc254f7ad Mon Sep 17 00:00:00 2001 From: TheNetworkGuy Date: Wed, 30 Oct 2024 21:25:58 +0100 Subject: [PATCH] Changed some logging messages and removed import logging statement from troubleshooting --- modules/device.py | 8 ++++---- modules/virtual_machine.py | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/device.py b/modules/device.py index cbc03ec..ee54891 100644 --- a/modules/device.py +++ b/modules/device.py @@ -145,12 +145,12 @@ class PhysicalDevice(): def get_templates_context(self): """ Get Zabbix templates from the device context """ if "zabbix" not in self.config_context: - e = ("Key 'zabbix' not found in config " - f"context for template host {self.name}") + e = (f"Host {self.name}: Key 'zabbix' not found in config " + "context for template") raise TemplateError(e) if "templates" not in self.config_context["zabbix"]: - e = ("Key 'templates' not found in config " - f"context 'zabbix' for template host {self.name}") + e = (f"Host {self.name}: Key 'templates' not found in config " + "context 'zabbix' for template host") raise TemplateError(e) return self.config_context["zabbix"]["templates"] diff --git a/modules/virtual_machine.py b/modules/virtual_machine.py index 8bbcd63..788a903 100644 --- a/modules/virtual_machine.py +++ b/modules/virtual_machine.py @@ -3,7 +3,6 @@ """Module that hosts all functions for virtual machine processing""" from os import sys -from logging import getLogger from modules.device import PhysicalDevice from modules.hostgroups import Hostgroup from modules.interface import ZabbixInterface