mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-24 11:06:24 +02:00
Refactor resource_filter to delegate default handling to get_app_conf and update unittests accordingly https://chatgpt.com/share/68d3ad6d-76b4-800f-b04e-5e1fb70b44f3
This commit is contained in:
@@ -28,12 +28,7 @@ def resource_filter(
|
||||
"""
|
||||
try:
|
||||
primary_service = service_name if service_name != "" else get_entity_name(application_id)
|
||||
|
||||
val = get_app_conf(applications, f"docker.services.{primary_service}.{key}", False, None)
|
||||
if val is not None:
|
||||
return val
|
||||
|
||||
return hard_default
|
||||
return get_app_conf(applications, application_id, f"docker.services.{primary_service}.{key}", False, hard_default)
|
||||
except (AppConfigKeyError, ConfigEntryNotSetError) as e:
|
||||
raise AnsibleFilterError(str(e))
|
||||
|
||||
|
Reference in New Issue
Block a user