From 83f27849afdaae6465872d1042b2d280c3900de9 Mon Sep 17 00:00:00 2001 From: Wouter de Bruijn Date: Tue, 17 Jun 2025 10:11:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Changed=20membership=20tests=20t?= =?UTF-8?q?o=20not=20in?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/interface.py | 2 +- modules/tools.py | 2 +- modules/usermacros.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/interface.py b/modules/interface.py index 58c2b6b..a4139f5 100644 --- a/modules/interface.py +++ b/modules/interface.py @@ -31,7 +31,7 @@ class ZabbixInterface: zabbix = self.context["zabbix"] if "interface_type" in zabbix: self.interface["type"] = zabbix["interface_type"] - if not "interface_port" in zabbix: + if "interface_port" not in zabbix: self._set_default_port() return True self.interface["port"] = zabbix["interface_port"] diff --git a/modules/tools.py b/modules/tools.py index f612993..d0f7ce7 100644 --- a/modules/tools.py +++ b/modules/tools.py @@ -188,7 +188,7 @@ def sanatize_log_output(data): del sanitized_data["interfaceid"] # InterfaceID also hints that this is a interface update. # A check is required if there are no macro's used for SNMP security parameters. - if not "details" in data: + if "details" not in data: return sanitized_data for key, detail in sanitized_data["details"].items(): # If the detail is a secret, we don't want to log it. diff --git a/modules/usermacros.py b/modules/usermacros.py index c1ef92f..2631a40 100644 --- a/modules/usermacros.py +++ b/modules/usermacros.py @@ -57,7 +57,7 @@ class ZabbixUsermacros: if self.validate_macro(macro_name): macro["macro"] = str(macro_name) if isinstance(macro_properties, dict): - if not "value" in macro_properties: + if "value" not in macro_properties: self.logger.warning( f"Host {self.name}: Usermacro {macro_name} has " "no value in Netbox, skipping."