From 634f4b77d5d7d6f60a427851546f92ec50e1386f Mon Sep 17 00:00:00 2001 From: Raymond Kuiper Date: Thu, 28 Mar 2024 09:51:08 +0100 Subject: [PATCH] tweaked exception handling --- netbox_zabbix_sync.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_zabbix_sync.py b/netbox_zabbix_sync.py index c3d4edd..c11feb2 100755 --- a/netbox_zabbix_sync.py +++ b/netbox_zabbix_sync.py @@ -379,7 +379,7 @@ class NetworkDevice(): e = (f"Custom field {template_cf} not " f"found for {self.nb.device_type.manufacturer.name}" f" - {self.nb.device_type.display}.") - raise TemplateError(e) from e + raise TemplateError(e) def get_templates_context(self): """ Get Zabbix templates from the device context """ @@ -493,7 +493,7 @@ class NetworkDevice(): e = (f"Unable to find template {nb_template} " f"for host {self.name} in Zabbix. Skipping host...") logger.warning(e) - raise SyncInventoryError(e) from e + raise SyncInventoryError(e) def getZabbixGroup(self, groups): """