Skip to content

Commit

Permalink
fixed linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
KiLLuuuhh committed Aug 7, 2024
1 parent 89c3e7d commit e5a9bba
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions plugins/module_utils/firewall_alias_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,6 @@ def to_etree(self) -> Element:
firewall_alias_dict[alias_key] = alias_val.value
continue

# Handle content field if it is a list
if isinstance(firewall_alias_dict.get("proto"), list):
firewall_alias_dict["proto"] = ",".join(
item.value for item in firewall_alias_dict["proto"]
)

if isinstance(firewall_alias_dict.get("content"), list):
firewall_alias_dict["content"] = (
"\n"
Expand Down Expand Up @@ -325,6 +319,7 @@ def __init__(self, path: str = "/conf/config.xml"):
)
self._aliases = self._load_aliases()
self._config_xml_tree = self._load_config()
self.group_list = []

try:
self.maximumtableentries = int(
Expand Down Expand Up @@ -484,7 +479,6 @@ def is_opnvpngroup(self, type_opnvpngroup_alias: str) -> bool:

element_tree_opnvpn_groups.findall("group")

self.group_list = []
for group in element_tree_opnvpn_groups:
if group.tag == "group":
self.group_list.append(Group.from_xml(group))
Expand Down Expand Up @@ -545,12 +539,12 @@ def is_interface(self, interface_name: str) -> bool:

return existing_interface

def is_geoip_configured(self, type_geoip_alias: str) -> bool:
def is_geoip_configured(self, _type_geoip_alias: str) -> bool:
"""
Checks if GeoIP is configured by validating the presence of a GeoIP URL.
Args:
type_geoip_alias (str): The type of GeoIP alias.
_type_geoip_alias (str): The type of GeoIP alias.
Returns:
bool: True if GeoIP URL is present and configured, False otherwise.
Expand Down Expand Up @@ -613,7 +607,10 @@ def validate_content(
},
"geoip": {
"validation_function": self.is_geoip_configured,
"error_message": "In order to use GeoIP, you need to configure a source in the GeoIP settings tab",
"error_message": (
"In order to use GeoIP, "
"you need to configure a source in the GeoIP settings tab"
),
},
}

Expand Down

0 comments on commit e5a9bba

Please sign in to comment.