Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

Commit

Permalink
Remove support for extensions as lists
Browse files Browse the repository at this point in the history
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
  • Loading branch information
afrittoli committed Apr 3, 2018
1 parent 40ef3c0 commit b3615c0
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions roles/stage-output/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b3615c0

Please sign in to comment.