From fad1608377d7a5df7c31c10e5a445da8fe675bb2 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Fri, 28 Jan 2022 01:40:09 -0800 Subject: [PATCH] migrate from ansible.netcommon to ansible.utils (#882) 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 Reviewed-by: Markus Bergholz This commit was initially merged in https://github.com/ansible-collections/community.aws See: https://github.com/ansible-collections/community.aws/commit/5e5f754736f4e851c446a1261cf3a1fd4b51f7b9 --- .../targets/ec2_eip/tasks/main.yml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/integration/targets/ec2_eip/tasks/main.yml b/tests/integration/targets/ec2_eip/tasks/main.yml index 48db1d1048a..66e2eb5b4ba 100644 --- a/tests/integration/targets/ec2_eip/tasks/main.yml +++ b/tests/integration/targets/ec2_eip/tasks/main.yml @@ -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 ) @@ -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 ) @@ -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 ) @@ -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 ) @@ -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 ) @@ -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 ) @@ -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 ) @@ -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 ) @@ -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 ) @@ -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 ) @@ -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) @@ -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: @@ -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: @@ -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: @@ -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 )