Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ec2_instance - Fix NoneType error on no input tags #856

Conversation

jatorcasso
Copy link
Contributor

@jatorcasso jatorcasso commented Jun 1, 2022

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
}

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review module module needs_triage plugins plugin (any type) small_patch Hopefully easy to review labels Jun 1, 2022
plugins/modules/ec2_instance.py Outdated Show resolved Hide resolved
plugins/modules/ec2_instance.py Show resolved Hide resolved
plugins/modules/ec2_instance.py Outdated Show resolved Hide resolved
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 31s
✔️ build-ansible-collection SUCCESS in 5m 01s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 9m 51s
✔️ ansible-test-sanity-aws-ansible-2.9-python38 SUCCESS in 11m 31s
✔️ ansible-test-sanity-aws-ansible-2.11-python38 SUCCESS in 9m 32s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 7m 20s
✔️ ansible-test-splitter SUCCESS in 2m 25s
✔️ integration-amazon.aws-1 SUCCESS in 33m 50s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@jatorcasso
Copy link
Contributor Author

@tremble updated tagging logic with some integration tests to validate

@ansibullbot ansibullbot added integration tests/integration tests tests and removed small_patch Hopefully easy to review labels Jun 1, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

✔️ ansible-galaxy-importer SUCCESS in 4m 04s
✔️ build-ansible-collection SUCCESS in 5m 07s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 10m 10s
✔️ ansible-test-sanity-aws-ansible-2.9-python38 SUCCESS in 16m 55s
✔️ ansible-test-sanity-aws-ansible-2.11-python38 SUCCESS in 9m 38s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 10s
✔️ ansible-test-splitter SUCCESS in 2m 29s
✔️ integration-amazon.aws-1 SUCCESS in 39m 35s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
✔️ integration-community.aws-1 SUCCESS in 50m 26s
✔️ integration-community.aws-2 SUCCESS in 9m 20s
✔️ integration-community.aws-3 SUCCESS in 20m 38s
✔️ integration-community.aws-4 SUCCESS in 46m 55s
✔️ integration-community.aws-5 SUCCESS in 39m 18s
integration-community.aws-6 TIMED_OUT in 1h 00m 44s
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@jatorcasso
Copy link
Contributor Author

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

✔️ ansible-galaxy-importer SUCCESS in 4m 02s
✔️ build-ansible-collection SUCCESS in 4m 46s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 9m 18s
✔️ ansible-test-sanity-aws-ansible-2.9-python38 SUCCESS in 11m 43s
✔️ ansible-test-sanity-aws-ansible-2.11-python38 SUCCESS in 11m 03s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 12s
✔️ ansible-test-splitter SUCCESS in 3m 02s
✔️ integration-amazon.aws-1 SUCCESS in 38m 24s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
✔️ integration-community.aws-1 SUCCESS in 43m 18s
✔️ integration-community.aws-2 SUCCESS in 8m 27s
integration-community.aws-3 TIMED_OUT in 1h 00m 40s
✔️ integration-community.aws-4 SUCCESS in 48m 54s
✔️ integration-community.aws-5 SUCCESS in 28m 50s
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@jatorcasso
Copy link
Contributor Author

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 22s
✔️ build-ansible-collection SUCCESS in 5m 05s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 10m 28s
✔️ ansible-test-sanity-aws-ansible-2.9-python38 SUCCESS in 12m 21s
✔️ ansible-test-sanity-aws-ansible-2.11-python38 SUCCESS in 10m 10s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 01s
✔️ ansible-test-splitter SUCCESS in 2m 25s
✔️ integration-amazon.aws-1 SUCCESS in 45m 45s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@jatorcasso jatorcasso requested a review from tremble June 2, 2022 04:17
@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Jun 2, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 5m 17s
✔️ build-ansible-collection SUCCESS in 4m 56s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 10m 14s
✔️ ansible-test-sanity-aws-ansible-2.9-python38 SUCCESS in 11m 41s
✔️ ansible-test-sanity-aws-ansible-2.11-python38 SUCCESS in 9m 03s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 31s
✔️ ansible-test-splitter SUCCESS in 2m 47s
✔️ integration-amazon.aws-1 SUCCESS in 42m 09s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
✔️ integration-community.aws-1 SUCCESS in 5m 04s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 6dd4c31 into ansible-collections:main Jun 2, 2022
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jun 9, 2022
*_info - improve RETURN block of docs

Depends-On: #856
SUMMARY
Fixes #843
Can things like checking for a period after description be added to our sanity checks?
ISSUE TYPE

Docs Pull Request

COMPONENT NAME

aws_ax_info
aws_caller_info
aws_s3
cloudformation_info
ec2_eni_info
ec2_group
ec2_group_info
ec2_instance_info
ec2_key
ec2_metadata_facts
ec2_snapshot_info
ec2_spot_instance
ec2_spot_instance_info
ec2_tag
ec2_tag_info
ec2_vpc_dhcp_option_info
ec2_vpc_endpoint_info
ec2_vpc_endpoint_service_info
ec2_vpc_igw_info
ec2_vpc_nat_gateway
ec2_vpc_nat_gateway_info
ec2_vpc_net_info
ec2_vpc_route_table_info
elb_classic_lb

Reviewed-by: Jill R <None>
Reviewed-by: Mark Chappell <None>
jatorcasso added a commit to jatorcasso/amazon.aws that referenced this pull request Jun 27, 2022
*_info - improve RETURN block of docs

Depends-On: ansible-collections#856
SUMMARY
Fixes ansible-collections#843
Can things like checking for a period after description be added to our sanity checks?
ISSUE TYPE

Docs Pull Request

COMPONENT NAME

aws_ax_info
aws_caller_info
aws_s3
cloudformation_info
ec2_eni_info
ec2_group
ec2_group_info
ec2_instance_info
ec2_key
ec2_metadata_facts
ec2_snapshot_info
ec2_spot_instance
ec2_spot_instance_info
ec2_tag
ec2_tag_info
ec2_vpc_dhcp_option_info
ec2_vpc_endpoint_info
ec2_vpc_endpoint_service_info
ec2_vpc_igw_info
ec2_vpc_nat_gateway
ec2_vpc_nat_gateway_info
ec2_vpc_net_info
ec2_vpc_route_table_info
elb_classic_lb

Reviewed-by: Jill R <None>
Reviewed-by: Mark Chappell <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review integration tests/integration mergeit Merge the PR (SoftwareFactory) module module plugins plugin (any type) python3 tests tests traceback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants