Skip to content

Conversation

@gtrummell
Copy link
Contributor

I ran into an issue described in Ansible on Python 3, in which the module fails when trying to iterate through keys:

TASK [Datadog.datadog : Create a configuration file for each Datadog check] ****
failed: [default] (item=dict_keys(['process'])) => {"failed": true, "item": "dict_keys(['process'])", "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute \"dict_keys(['process'])\""}

PLAY RECAP *********************************************************************
default                    : ok=8    changed=6    unreachable=0    failed=1

Ansible developers recommend piping dicts through list to work around this issue. Trying this on my own Ansible 2.2.1.0/Python 3 environment, I was able to eliminate the issue. The discussion on the issue indicates that this is backward-compatible with lesser versions of Ansible and Python.

I ran into [an issue described in Ansible on Python 3](ansible/ansible#19514), in which the module fails when trying to iterate through keys:
```
TASK [Datadog.datadog : Create a configuration file for each Datadog check] ****
failed: [default] (item=dict_keys(['process'])) => {"failed": true, "item": "dict_keys(['process'])", "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute \"dict_keys(['process'])\""}

PLAY RECAP *********************************************************************
default                    : ok=8    changed=6    unreachable=0    failed=1
```

Ansible developers recommend piping dicts through `list` to work around this issue. Trying this on my own Ansible 2.2.1.0/Python 3 environment, I was able to eliminate the issue. The discussion on the issue indicates that this is backward-compatible with lesser versions of Ansible and Python.
Copy link
Member

@olivielpeau olivielpeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @gtrummell! (and thanks for the detailed description)

@olivielpeau olivielpeau added this to the 1.3.0 milestone Mar 31, 2017
@olivielpeau olivielpeau merged commit ac05ba1 into DataDog:master Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants