🚨 Changed membership tests to not in

This commit is contained in:
Wouter de Bruijn 2025-06-17 10:11:57 +02:00
parent 767f974ad8
commit 83f27849af
No known key found for this signature in database
GPG Key ID: AC71F96733B92BFA
3 changed files with 3 additions and 3 deletions

View File

@ -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"]

View File

@ -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.

View File

@ -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."