Skip to content

Commit

Permalink
migrate from ansible.netcommon to ansible.utils (ansible-collections#882
Browse files Browse the repository at this point in the history
)

migrate from ansible.netcommon to ansible.utils

SUMMARY

This is a maintenance task to migrate from ansible.netcommon to ansible.utils. I was trying to fix an issue in that module, but I was told the functions have moved to ansible.utils. See ansible-collections/ansible.netcommon#362 (comment)

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

Existing integration tests that use the ansible.netcommon module. No module uses netcommon, only integration tests.
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Markus Bergholz <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@5e5f754
  • Loading branch information
sebastien-rosset authored and goneri committed Sep 21, 2022
1 parent 7d49308 commit fad1608
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions tests/integration/targets/ec2_eip/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
that:
- eip is defined
- eip is changed
- eip.public_ip is defined and ( eip.public_ip | ansible.netcommon.ipaddr )
- eip.public_ip is defined and ( eip.public_ip | ansible.utils.ipaddr )
- eip.allocation_id is defined and eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 1 == ( eip_info.addresses | length )

Expand Down Expand Up @@ -160,7 +160,7 @@
that:
- eip is defined
- eip is changed
- eip.public_ip is defined and ( eip.public_ip | ansible.netcommon.ipaddr )
- eip.public_ip is defined and ( eip.public_ip | ansible.utils.ipaddr )
- eip.allocation_id is defined and eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 1 == ( eip_info.addresses | length )

Expand All @@ -175,7 +175,7 @@
that:
- reallocate_eip is defined
- reallocate_eip is not changed
- reallocate_eip.public_ip is defined and ( reallocate_eip.public_ip | ansible.netcommon.ipaddr )
- reallocate_eip.public_ip is defined and ( reallocate_eip.public_ip | ansible.utils.ipaddr )
- reallocate_eip.allocation_id is defined and reallocate_eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 1 == ( eip_info.addresses | length )

Expand All @@ -202,7 +202,7 @@
that:
- eip is defined
- eip is changed
- eip.public_ip is defined and ( eip.public_ip | ansible.netcommon.ipaddr )
- eip.public_ip is defined and ( eip.public_ip | ansible.utils.ipaddr )
- eip.allocation_id is defined and eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 1 == ( eip_info.addresses | length )

Expand All @@ -217,7 +217,7 @@
that:
- reallocate_eip is defined
- reallocate_eip is not changed
- reallocate_eip.public_ip is defined and ( reallocate_eip.public_ip | ansible.netcommon.ipaddr )
- reallocate_eip.public_ip is defined and ( reallocate_eip.public_ip | ansible.utils.ipaddr )
- reallocate_eip.allocation_id is defined and reallocate_eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 1 == ( eip_info.addresses | length )

Expand All @@ -244,7 +244,7 @@
that:
- eip is defined
- eip is changed
- eip.public_ip is defined and ( eip.public_ip | ansible.netcommon.ipaddr )
- eip.public_ip is defined and ( eip.public_ip | ansible.utils.ipaddr )
- eip.allocation_id is defined and eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 1 == ( eip_info.addresses | length )

Expand All @@ -260,7 +260,7 @@
that:
- no_tagged_eip is defined
- no_tagged_eip is changed
- no_tagged_eip.public_ip is defined and ( no_tagged_eip.public_ip | ansible.netcommon.ipaddr )
- no_tagged_eip.public_ip is defined and ( no_tagged_eip.public_ip | ansible.utils.ipaddr )
- no_tagged_eip.allocation_id is defined and no_tagged_eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 2 == ( eip_info.addresses | length )

Expand All @@ -283,7 +283,7 @@
that:
- reallocate_eip is defined
- reallocate_eip is not changed
- reallocate_eip.public_ip is defined and ( reallocate_eip.public_ip | ansible.netcommon.ipaddr )
- reallocate_eip.public_ip is defined and ( reallocate_eip.public_ip | ansible.utils.ipaddr )
- reallocate_eip.allocation_id is defined and reallocate_eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 2 == ( eip_info.addresses | length )

Expand All @@ -300,7 +300,7 @@
that:
- backend_eip is defined
- backend_eip is changed
- backend_eip.public_ip is defined and ( backend_eip.public_ip | ansible.netcommon.ipaddr )
- backend_eip.public_ip is defined and ( backend_eip.public_ip | ansible.utils.ipaddr )
- backend_eip.allocation_id is defined and backend_eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 3 == ( eip_info.addresses | length )

Expand Down Expand Up @@ -378,7 +378,7 @@
that:
- eip is defined
- eip is changed
- eip.public_ip is defined and ( eip.public_ip | ansible.netcommon.ipaddr )
- eip.public_ip is defined and ( eip.public_ip | ansible.utils.ipaddr )
- eip.allocation_id is defined and eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 1 == ( eip_info.addresses | length )

Expand Down Expand Up @@ -413,7 +413,7 @@
- eip_info.addresses[0].public_ip == eip.public_ip
- eip_info.addresses[0].association_id is defined and eip_info.addresses[0].association_id.startswith("eipassoc-")
- eip_info.addresses[0].network_interface_id == eni_create_a.interface.id
- eip_info.addresses[0].private_ip_address is defined and ( eip_info.addresses[0].private_ip_address | ansible.netcommon.ipaddr )
- eip_info.addresses[0].private_ip_address is defined and ( eip_info.addresses[0].private_ip_address | ansible.utils.ipaddr )
- eip_info.addresses[0].network_interface_owner_id == caller_info.account

- name: Re-Attach EIP to ENI A (no change)
Expand All @@ -437,7 +437,7 @@
- eip_info.addresses[0].public_ip == eip.public_ip
- eip_info.addresses[0].association_id is defined and eip_info.addresses[0].association_id.startswith("eipassoc-")
- eip_info.addresses[0].network_interface_id == eni_create_a.interface.id
- eip_info.addresses[0].private_ip_address is defined and ( eip_info.addresses[0].private_ip_address | ansible.netcommon.ipaddr )
- eip_info.addresses[0].private_ip_address is defined and ( eip_info.addresses[0].private_ip_address | ansible.utils.ipaddr )

- name: Attach EIP to ENI B (should fail, already associated)
ec2_eip:
Expand All @@ -459,7 +459,7 @@
- eip_info.addresses[0].public_ip == eip.public_ip
- eip_info.addresses[0].association_id is defined and eip_info.addresses[0].association_id.startswith("eipassoc-")
- eip_info.addresses[0].network_interface_id == eni_create_a.interface.id
- eip_info.addresses[0].private_ip_address is defined and ( eip_info.addresses[0].private_ip_address | ansible.netcommon.ipaddr )
- eip_info.addresses[0].private_ip_address is defined and ( eip_info.addresses[0].private_ip_address | ansible.utils.ipaddr )

- name: Attach EIP to ENI B
ec2_eip:
Expand All @@ -483,7 +483,7 @@
- eip_info.addresses[0].public_ip == eip.public_ip
- eip_info.addresses[0].association_id is defined and eip_info.addresses[0].association_id.startswith("eipassoc-")
- eip_info.addresses[0].network_interface_id == eni_create_b.interface.id
- eip_info.addresses[0].private_ip_address is defined and ( eip_info.addresses[0].private_ip_address | ansible.netcommon.ipaddr )
- eip_info.addresses[0].private_ip_address is defined and ( eip_info.addresses[0].private_ip_address | ansible.utils.ipaddr )

- name: Detach EIP from ENI B, without enabling release on disassociation
ec2_eip:
Expand Down Expand Up @@ -667,7 +667,7 @@
that:
- eip is defined
- eip is changed
- eip.public_ip is defined and ( eip.public_ip | ansible.netcommon.ipaddr )
- eip.public_ip is defined and ( eip.public_ip | ansible.utils.ipaddr )
- eip.allocation_id is defined and eip.allocation_id.startswith("eipalloc-")
- ( eip_info_start.addresses | length ) + 1 == ( eip_info.addresses | length )

Expand Down

0 comments on commit fad1608

Please sign in to comment.