Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ec2_instance - Fix NoneType error on no input tags (#856)
ec2_instance - Fix NoneType error on no input tags SUMMARY Reverts bug introduced in #849 which throws a NoneType exception when tags are not input ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_instance ADDITIONAL INFORMATION The error gets thrown when trying to wrap dict(None). See https://ansible.softwarefactory-project.io/zuul/build/5e37b5947f7045c6bf01e88f8ae5271f TASK [elb_classic_lb : Wait for instance a] ************************************ task path: /home/zuul/.ansible/collections/ansible_collections/amazon/aws/tests/integration/targets/elb_classic_lb/tasks/simple_instances.yml:18 Using module file /home/zuul/.ansible/collections/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py Pipelining is enabled. <testhost> ESTABLISH LOCAL CONNECTION FOR USER: zuul <testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /home/zuul/venv/bin/python && sleep 0' The full traceback is: Traceback (most recent call last): File "<stdin>", line 121, in <module> File "<stdin>", line 113, in _ansiballz_main File "<stdin>", line 61, in invoke_module File "/usr/lib64/python3.8/runpy.py", line 207, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib64/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/tmp/ansible_ec2_instance_payload_ofa2yzhm/ansible_ec2_instance_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py", line 2105, in <module> File "/tmp/ansible_ec2_instance_payload_ofa2yzhm/ansible_ec2_instance_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py", line 2097, in main File "/tmp/ansible_ec2_instance_payload_ofa2yzhm/ansible_ec2_instance_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py", line 1783, in handle_existing TypeError: 'NoneType' object is not iterable fatal: [testhost]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"<stdin>\", line 121, in <module>\n File \"<stdin>\", line 113, in _ansiballz_main\n File \"<stdin>\", line 61, in invoke_module\n File \"/usr/lib64/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib64/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_ec2_instance_payload_ofa2yzhm/ansible_ec2_instance_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py\", line 2105, in <module>\n File \"/tmp/ansible_ec2_instance_payload_ofa2yzhm/ansible_ec2_instance_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py\", line 2097, in main\n File \"/tmp/ansible_ec2_instance_payload_ofa2yzhm/ansible_ec2_instance_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_instance.py\", line 1783, in handle_existing\nTypeError: 'NoneType' object is not iterable\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } Reviewed-by: Mark Chappell <None> Reviewed-by: Joseph Torcasso <None>
- Loading branch information