Added dict parsing

This commit is contained in:
Kevin Veen-Birkenbach 2025-05-17 17:26:46 +02:00
parent d115a6f139
commit d1a027c1cf
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E

View File

@ -90,9 +90,10 @@ class LookupModule(LookupBase):
applications = variables.get("applications", {}) applications = variables.get("applications", {})
domain_url = domains.get(application_id, "") domain_url = domains.get(application_id, "")
# Check if domain_url is a list. If so, select the first element.
if isinstance(domain_url, list): if isinstance(domain_url, list):
domain_url = domain_url[0] domain_url = domain_url[0]
elif isinstance(domain_url, dict):
domain_url = next(iter(domain_url.values()))
# Construct the URL using the domain_url if available. # Construct the URL using the domain_url if available.
url = "https://" + domain_url if domain_url else "" url = "https://" + domain_url if domain_url else ""