Skip to content

Allow lookups to return python data structures#14591

Merged
sivel merged 1 commit intoansible:develfrom
sivel:issue/14541
Feb 20, 2016
Merged

Allow lookups to return python data structures#14591
sivel merged 1 commit intoansible:develfrom
sivel:issue/14541

Conversation

@sivel
Copy link
Member

@sivel sivel commented Feb 20, 2016

Issue Type:

Bugfix Pull Request

Ansible Version:
v2
Summary:

Fixes #14541. This change allows a lookup to return python data structures. As is if a lookup returns a python data structure or a string that evaluates as a python data structure, a TypeError is raised while trying to join the results with a comma.

This change catches that TypeError and will either a single item of the list if the list was only 1 element long, or return the list itself.

Example output:

N/A

@sivel
Copy link
Member Author

sivel commented Feb 20, 2016

This PR should also be cherry picked into stable-2.0

@sivel sivel added this to the 2.1.0 milestone Feb 20, 2016
sivel added a commit that referenced this pull request Feb 20, 2016
Allow lookups to return python data structures
@sivel sivel merged commit f8211f8 into ansible:devel Feb 20, 2016
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 5, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug This issue/PR relates to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

safe_eval prevents lookups from returning JSON

2 participants