Solved other minor bugs

This commit is contained in:
2025-07-04 22:12:42 +02:00
parent 7950a3f517
commit c3575e5647
3 changed files with 4 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ def application_allowed(application_id: str, group_names: list, allowed_applicat
"""
# Ensure group_names is iterable
if not isinstance(group_names, (list, tuple)):
raise AnsibleFilterError(f"Expected group_names to be a list or tuple, got {type(group_names)}")
raise AnsibleFilterError(f"Expected group_names to be a list, str or tuple, got {type(group_names)}")
# Must be part of the host's groups
if application_id not in group_names:
@@ -29,7 +29,7 @@ def application_allowed(application_id: str, group_names: list, allowed_applicat
# If allowed_applications provided, only allow if ID is in that list
if allowed_applications:
if not isinstance(allowed_applications, (list, tuple)):
if not isinstance(allowed_applications, (list, tuple, str)):
raise AnsibleFilterError(f"allowed_applications must be a list or tuple if provided, got {type(allowed_applications)}")
return application_id in allowed_applications