From 1f22f40eb4cf1d8ca156be5f91737d33bddc9a93 Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Jul 26 2022 19:24:17 +0000 Subject: "compose" var doesn't have to be defined Don't render "compose" part of the template if compose is undefined or empty. Signed-off-by: Michal Srb --- diff --git a/roles/testing-farm-run-generic-test/tasks/main.yml b/roles/testing-farm-run-generic-test/tasks/main.yml index 1550c47..4c73b14 100644 --- a/roles/testing-farm-run-generic-test/tasks/main.yml +++ b/roles/testing-farm-run-generic-test/tasks/main.yml @@ -22,7 +22,7 @@ "variables": { "REPO_URL": "{{ (zuul.artifacts|selectattr('name', 'eq', 'repo')|selectattr('change', 'eq', zuul.change)|selectattr('patchset', 'eq', zuul.patchset)|first).url }}" }, - {%- if compose -%} + {%- if compose is defined and compose|length -%} "os": { "compose": "{{ compose }}" } @@ -56,7 +56,7 @@ "variables": { "REPO_URL": "{{ (zuul.artifacts|selectattr('name', 'eq', 'repo')|selectattr('change', 'eq', zuul.change)|selectattr('patchset', 'eq', zuul.patchset)|first).url }}" }, - {%- if compose -%} + {%- if compose is defined and compose|length -%} "os": { "compose": "{{ compose }}" }