Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subelements conditional failure for filetree_create and object_diff #694

Merged

Conversation

adonisgarciac
Copy link
Contributor

What does this PR do?

Loops with subelements were failing with error: "obj must be a list of dicts or a nested dict".

This was because subelement filter is executed before when and it was causing a failure when the list was not defined.

How should this be tested?

  • name: test
    hosts: localhost
    gather_facts: false
    vars:
    __controller_api_current_user_check_is_admin:
    is_superuser: false

    tasks:
    - name: "Test nested condition"
    ansible.builtin.set_fact:
    __full_controller_api_roles: []
    loop: "{{ current_users | default([]) | subelements('organizations', skip_missing=true) }}"
    when: __controller_api_current_user_check_is_admin.is_superuser

@sean-m-sullivan
Copy link
Collaborator

needs to be rebased, and a line at end of file on the fragment.

@Tompage1994 Tompage1994 merged commit 6e5c972 into redhat-cop:devel Sep 18, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants