cytopia / cytopia/ansible-modules
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
- Dominant language
- Python
- Stars
- 19
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
I know that this was built 5 years ago, but I'm looking for this exact piece of functionality with ansible :(
Receiving this error:
```Traceback (most recent call last):
File "/Users/duffy/.ansible/tmp/ansible-tmp-1663685850.6367428-32076-118898947106338/AnsiballZ_cloudformation_diff.py", line 107, in
_ansiballz_main()
File "/Users/duffy/.ansible/tmp/ansible-tmp-1663685850.6367428-32076-118898947106338/AnsiballZ_cloudformation_diff.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/Users/duffy/.ansible/tmp/ansible-tmp-1663685850.6367428-32076-118898947106338/AnsiballZ_cloudformation_diff.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible.modules.cloudformation_diff', init_globals=dict(_module_fqn='ansible.modules.cloudformation_diff', _modlib_path=modlib_path),
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 224, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/var/folders/q3/bbn7n5hn4xdbkw68fy1pxhyw0000gn/T/ansible_cloudformation_diff_payload_eg0bs710/ansible_cloudformation_diff_payload.zip/ansible/modules/cloudformation_diff.py", line 590, in
File "/var/folders/q3/bbn7n5hn4xdbkw68fy1pxhyw0000gn/T/ansible_cloudformation_diff_payload_eg0bs710/ansible_cloudformation_diff_payload.zip/ansible/modules/cloudformation_diff.py", line 488, in main
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
failed: [localhost] (item=default-routes) => {
"ansible_loop_var": "item",
"changed": false,
"item": {
"accounting": "platform",
"classification": "standard",
"name": "default-routes",
"owner": "devops",
"product": "platform",
"service": "platform"
},
"rc": 1
}
MSG:
MODULE FAILURE
See stdout/stderr for the exact error
MODULE_STDERR:
Traceback (most recent call last):
File "/Users/duffy/.ansible/tmp/ansible-tmp-1663685850.6367428-32076-118898947106338/AnsiballZ_cloudformation_diff.py", line 107, in
_ansiballz_main()
File "/Users/duffy/.ansible/tmp/ansible-tmp-1663685850.6367428-32076-118898947106338/AnsiballZ_cloudformation_diff.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/Users/duffy/.ansible/tmp/ansible-tmp-1663685850.6367428-32076-118898947106338/AnsiballZ_cloudformation_diff.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible.modules.cloudformation_diff', init_globals=dict(_module_fqn='ansible.modules.cloudformation_diff', _modlib_path=modlib_path),
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 224, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/var/folders/q3/bbn7n5hn4xdbkw68fy1pxhyw0000gn/T/ansible_cloudformation_diff_payload_eg0bs710/ansible_cloudformation_diff_payload.zip/ansible/modules/cloudformation_diff.py", line 590, in
File "/var/folders/q3/bbn7n5hn4xdbkw68fy1pxhyw0000gn/T/ansible_cloudformation_diff_payload_eg0bs710/ansible_cloudformation_diff_payload.zip/ansible/modules/cloudformation_diff.py", line 488, in main
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?```
I'm using macos, python3.10
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with ansible/modules/cloudformation_diff.py around line 488, the location named in the traceback, and inspect the failing execution under Python 3.10. Reproduce the cloudformation_diff invocation on macOS, then verify that it completes without the reported AttributeError and preserves the module's expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100