mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Solved other minor bugs
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user