Changed some logging messages and removed import logging statement from troubleshooting

This commit is contained in:
TheNetworkGuy 2024-10-30 21:25:58 +01:00
parent 20096a215b
commit 06f97b132a
2 changed files with 4 additions and 5 deletions

View File

@ -145,12 +145,12 @@ class PhysicalDevice():
def get_templates_context(self): def get_templates_context(self):
""" Get Zabbix templates from the device context """ """ Get Zabbix templates from the device context """
if "zabbix" not in self.config_context: if "zabbix" not in self.config_context:
e = ("Key 'zabbix' not found in config " e = (f"Host {self.name}: Key 'zabbix' not found in config "
f"context for template host {self.name}") "context for template")
raise TemplateError(e) raise TemplateError(e)
if "templates" not in self.config_context["zabbix"]: if "templates" not in self.config_context["zabbix"]:
e = ("Key 'templates' not found in config " e = (f"Host {self.name}: Key 'templates' not found in config "
f"context 'zabbix' for template host {self.name}") "context 'zabbix' for template host")
raise TemplateError(e) raise TemplateError(e)
return self.config_context["zabbix"]["templates"] return self.config_context["zabbix"]["templates"]

View File

@ -3,7 +3,6 @@
"""Module that hosts all functions for virtual machine processing""" """Module that hosts all functions for virtual machine processing"""
from os import sys from os import sys
from logging import getLogger
from modules.device import PhysicalDevice from modules.device import PhysicalDevice
from modules.hostgroups import Hostgroup from modules.hostgroups import Hostgroup
from modules.interface import ZabbixInterface from modules.interface import ZabbixInterface