From b3615c0d970690e4b13facf319dba92acc6eb4f2 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Mon, 5 Feb 2018 15:27:04 +0000 Subject: [PATCH] Remove support for extensions as lists With tempest devstack and networking-odl switched to using dict, we can now remove support for using lists for the list of extensions. Depends-on: https://review.openstack.org/539686/ Depends-on: https://review.openstack.org/539708/ Depends-on: https://review.openstack.org/539854/ Change-Id: I62aaa737300c3b24e416f18e4bc469e7bd46ea29 --- roles/stage-output/tasks/main.yaml | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/roles/stage-output/tasks/main.yaml b/roles/stage-output/tasks/main.yaml index 5b6d2f043..4b5924227 100644 --- a/roles/stage-output/tasks/main.yaml +++ b/roles/stage-output/tasks/main.yaml @@ -5,34 +5,18 @@ register: sources no_log: true -- name: Output a warning when input is not a dict and not empty - debug: - msg: "WARNING: extensions_to_txt is a list, values defined by parents will be overwritten" - when: - - extensions_to_txt is not mapping - - extensions_to_txt - -- name: Build the extensions list when input is not a dict (including empty) +- name: Build the extensions list from a dict (or empty) set_fact: extension_list: > - {% set extensions = ['__does_not_match__'] -%} + {% set extensions = ['__do_not_match__'] -%} {% if extensions_to_txt -%} - {% set extensions = extensions_to_txt -%} + {% for extension, extension_bool in extensions_to_txt.items() -%} + {% if extension_bool -%} + {% set _ = extensions.append(extension) -%} + {% endif -%} + {% endfor -%} {% endif -%} {{- extensions -}} - when: extensions_to_txt is not mapping - -- name: Build the extensions list when input is a dict - set_fact: - extension_list: > - {% set extensions = [] -%} - {% for extension, extension_bool in extensions_to_txt.items() -%} - {% if extension_bool -%} - {% set _ = extensions.append(extension) -%} - {% endif -%} - {% endfor -%} - {{- extensions -}} - when: extensions_to_txt is mapping - name: Build the extensions regular expression set_fact: