mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-13 15:24:48 -06:00
Fixed config bug and #111
This commit is contained in:
parent
7b8827fa94
commit
c8fda04ce8
@ -118,7 +118,4 @@ def load_config_file(config_default, config_file="config.py"):
|
|||||||
if hasattr(config_module, key):
|
if hasattr(config_module, key):
|
||||||
dconf[key] = getattr(config_module, key)
|
dconf[key] = getattr(config_module, key)
|
||||||
return dconf
|
return dconf
|
||||||
logger.warning(
|
return config_default
|
||||||
"Config file %s not found. Using default config "
|
|
||||||
"and environment variables.", config_file)
|
|
||||||
return None
|
|
@ -8,10 +8,10 @@ from logging import getLogger
|
|||||||
from re import search
|
from re import search
|
||||||
|
|
||||||
from zabbix_utils import APIRequestError
|
from zabbix_utils import APIRequestError
|
||||||
|
from pynetbox import RequestError as NetboxRequestError
|
||||||
|
|
||||||
from modules.exceptions import (
|
from modules.exceptions import (
|
||||||
InterfaceConfigError,
|
InterfaceConfigError,
|
||||||
JournalError,
|
|
||||||
SyncExternalError,
|
SyncExternalError,
|
||||||
SyncInventoryError,
|
SyncInventoryError,
|
||||||
TemplateError,
|
TemplateError,
|
||||||
@ -896,7 +896,7 @@ class PhysicalDevice:
|
|||||||
self.nb_journals.create(journal)
|
self.nb_journals.create(journal)
|
||||||
self.logger.debug(f"Host {self.name}: Created journal entry in NetBox")
|
self.logger.debug(f"Host {self.name}: Created journal entry in NetBox")
|
||||||
return True
|
return True
|
||||||
except JournalError(e) as e:
|
except NetboxRequestError as e:
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
"Unable to create journal entry for "
|
"Unable to create journal entry for "
|
||||||
f"{self.name}: NB returned {e}"
|
f"{self.name}: NB returned {e}"
|
||||||
|
Loading…
Reference in New Issue
Block a user