You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'items'
fatal: [vm-9541 -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/nerdnode/.ansible/tmp/ansible-tmp-1726833636.5554516-274325-21926886816507/AnsiballZ_lxd_container.py\", line 107, in <module>\n _ansiballz_main()\n File \"/home/nerdnode/.ansible/tmp/ansible-tmp-1726833636.5554516-274325-21926886816507/AnsiballZ_lxd_container.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/nerdnode/.ansible/tmp/ansible-tmp-1726833636.5554516-274325-21926886816507/AnsiballZ_lxd_container.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.lxd_container', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.lxd_container', _modlib_path=modlib_path),\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _run_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/tmp/ansible_community.general.lxd_container_payload_wii3zqjo/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py\", line 901, in <module>\n File \"/tmp/ansible_community.general.lxd_container_payload_wii3zqjo/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py\", line 897, in main\n File \"/tmp/ansible_community.general.lxd_container_payload_wii3zqjo/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py\", line 771, in run\nAttributeError: 'NoneType' object has no attribute 'items'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
Yep, it should have been for k, v in data.get('network', {}).items() and not for k, v in (data.get('network') or {}).items(). These have slightly different semantics.
Summary
When trying to use
lxd_container
it failsIssue Type
Bug Report
Component Name
Looks like the dictionary comprehension update broke the module
#8814
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
No response
Steps to Reproduce
Expected Results
Ran without errors.
Actual Results
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'items' fatal: [vm-9541 -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/nerdnode/.ansible/tmp/ansible-tmp-1726833636.5554516-274325-21926886816507/AnsiballZ_lxd_container.py\", line 107, in <module>\n _ansiballz_main()\n File \"/home/nerdnode/.ansible/tmp/ansible-tmp-1726833636.5554516-274325-21926886816507/AnsiballZ_lxd_container.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/nerdnode/.ansible/tmp/ansible-tmp-1726833636.5554516-274325-21926886816507/AnsiballZ_lxd_container.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.lxd_container', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.lxd_container', _modlib_path=modlib_path),\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _run_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/tmp/ansible_community.general.lxd_container_payload_wii3zqjo/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py\", line 901, in <module>\n File \"/tmp/ansible_community.general.lxd_container_payload_wii3zqjo/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py\", line 897, in main\n File \"/tmp/ansible_community.general.lxd_container_payload_wii3zqjo/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py\", line 771, in run\nAttributeError: 'NoneType' object has no attribute 'items'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
community.general/plugins/modules/lxd_container.py
Lines 769 to 773 in 6af74d1
Code of Conduct
The text was updated successfully, but these errors were encountered: