diff --git a/modules/device.py b/modules/device.py index d28e670..5d2a216 100644 --- a/modules/device.py +++ b/modules/device.py @@ -890,16 +890,15 @@ class PhysicalDevice: raise SyncExternalError(msg) from e else: # If no updates are found, Zabbix interface is in-sync - e = f"Host {self.name}: interface in-sync." - self.logger.debug(e) + self.logger.debug("Host %s: interface in-sync.", self.name) else: - e = ( + error_message = ( f"Host {self.name} has unsupported interface configuration." f" Host has total of {len(host['interfaces'])} interfaces. " "Manual intervention required." ) - self.logger.error(e) - raise SyncInventoryError(e) + self.logger.error(error_message) + raise SyncInventoryError(error_message) def create_journal_entry(self, severity, message): """ diff --git a/netbox_zabbix_sync.py b/netbox_zabbix_sync.py index 1f9ab44..76507c4 100755 --- a/netbox_zabbix_sync.py +++ b/netbox_zabbix_sync.py @@ -244,16 +244,16 @@ def main(arguments): if device.isCluster() and config["clustering"]: # Check if device is primary or secondary if device.promoteMasterDevice(): - e = f"Device {device.name}: is " f"part of cluster and primary." - logger.info(e) + logger.info( + "Device %s: is part of cluster and primary.", device.name + ) else: # Device is secondary in cluster. # Don't continue with this device. - e = ( - f"Device {device.name}: is part of cluster " - f"but not primary. Skipping this host..." + logger.info( + "Device %s: is part of cluster but not primary. Skipping this host...", + device.name, ) - logger.info(e) continue # Checks if device is in cleanup state if device.status in config["zabbix_device_removal"]: