Fixed config bug and #111

This commit is contained in:
TheNetworkGuy 2025-06-12 11:08:21 +00:00
parent 7b8827fa94
commit c8fda04ce8
2 changed files with 3 additions and 6 deletions

View File

@ -118,7 +118,4 @@ def load_config_file(config_default, config_file="config.py"):
if hasattr(config_module, key):
dconf[key] = getattr(config_module, key)
return dconf
logger.warning(
"Config file %s not found. Using default config "
"and environment variables.", config_file)
return None
return config_default

View File

@ -8,10 +8,10 @@ from logging import getLogger
from re import search
from zabbix_utils import APIRequestError
from pynetbox import RequestError as NetboxRequestError
from modules.exceptions import (
InterfaceConfigError,
JournalError,
SyncExternalError,
SyncInventoryError,
TemplateError,
@ -896,7 +896,7 @@ class PhysicalDevice:
self.nb_journals.create(journal)
self.logger.debug(f"Host {self.name}: Created journal entry in NetBox")
return True
except JournalError(e) as e:
except NetboxRequestError as e:
self.logger.warning(
"Unable to create journal entry for "
f"{self.name}: NB returned {e}"