Skip to content

Commit

Permalink
Don't check aws_az_info 'zone_type' it's only returned when botocore …
Browse files Browse the repository at this point in the history
…>= 1.17.18 (ansible-collections#454)

Don't check aws_az_info 'zone_type' it's only returned when botocore >= 1.17.18

SUMMARY
AWS 'zone_type' info is only returned when botocore >= 1.17.18.  Since we don't document what's returned we can get away with not testing this until the next botocore bump.
ISSUE TYPE

Tests Pull Request

COMPONENT NAME
aws_az_info
ADDITIONAL INFORMATION
Depends-On: ansible-collections#460

Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
  • Loading branch information
tremble authored Aug 12, 2021
1 parent 54d313b commit b1e6bfd
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions tests/integration/targets/aws_az_info/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
- '"state" in first_az'
- '"zone_id" in first_az'
- '"zone_name" in first_az'
- '"zone_type" in first_az'
# botocore >= 1.17.18
#- '"zone_type" in first_az'

- name: 'List available AZs in current Region - check_mode'
aws_az_info:
Expand All @@ -48,7 +49,8 @@
- '"state" in first_az'
- '"zone_id" in first_az'
- '"zone_name" in first_az'
- '"zone_type" in first_az'
# botocore >= 1.17.18
#- '"zone_type" in first_az'


# Be specific - aws_region isn't guaranteed to be any specific value
Expand All @@ -72,15 +74,17 @@
- '"state" in first_az'
- '"zone_id" in first_az'
- '"zone_name" in first_az'
- '"zone_type" in first_az'
# botocore >= 1.17.18
#- '"zone_type" in first_az'
- first_az.group_name.startswith('us-east-1')
- first_az.network_border_group.startswith('us-east-1')
- first_az.region_name == 'us-east-1'
- first_az.zone_id.startswith('use1-az')
- not first_az.zone_id == "use1-az"
- first_az.zone_name.startswith('us-east-1')
- not first_az.zone_name == 'us-east-1'
- first_az.zone_type == 'availability-zone'
# botocore >= 1.17.18
#- first_az.zone_type == 'availability-zone'

- name: 'Filter Available AZs in us-west-2 using - ("zone-name")'
aws_az_info:
Expand All @@ -105,15 +109,17 @@
- '"state" in first_az'
- '"zone_id" in first_az'
- '"zone_name" in first_az'
- '"zone_type" in first_az'
# botocore >= 1.17.18
#- '"zone_type" in first_az'
- first_az.group_name == 'us-west-2'
- first_az.network_border_group == 'us-west-2'
- first_az.region_name == 'us-west-2'
# AZs are mapped to the 'real' AZs on a per-account basis
- first_az.zone_id.startswith('usw2-az')
- not first_az.zone_id == 'usw2-az'
- first_az.zone_name == 'us-west-2c'
- first_az.zone_type == 'availability-zone'
# botocore >= 1.17.18
#- first_az.zone_type == 'availability-zone'

- name: 'Filter Available AZs in eu-central-1 using _ ("zone_name")'
aws_az_info:
Expand All @@ -138,15 +144,17 @@
- '"state" in first_az'
- '"zone_id" in first_az'
- '"zone_name" in first_az'
- '"zone_type" in first_az'
# botocore >= 1.17.18
#- '"zone_type" in first_az'
- first_az.group_name == 'eu-central-1'
- first_az.network_border_group == 'eu-central-1'
- first_az.region_name == 'eu-central-1'
# AZs are mapped to the 'real' AZs on a per-account basis
- first_az.zone_id.startswith('euc1-az')
- not first_az.zone_id == "euc1-az"
- first_az.zone_name == 'eu-central-1b'
- first_az.zone_type == 'availability-zone'
# botocore >= 1.17.18
#- first_az.zone_type == 'availability-zone'

- name: 'Filter Available AZs in eu-west-2 using _ and - ("zone_name" and "zone-name") : _ wins '
aws_az_info:
Expand All @@ -172,12 +180,14 @@
- '"state" in first_az'
- '"zone_id" in first_az'
- '"zone_name" in first_az'
- '"zone_type" in first_az'
# botocore >= 1.17.18
#- '"zone_type" in first_az'
- first_az.group_name == 'eu-west-2'
- first_az.network_border_group == 'eu-west-2'
- first_az.region_name == 'eu-west-2'
# AZs are mapped to the 'real' AZs on a per-account basis
- first_az.zone_id.startswith('euw2-az')
- not first_az.zone_id == "euw2-az"
- first_az.zone_name == 'eu-west-2c'
- first_az.zone_type == 'availability-zone'
# botocore >= 1.17.18
#- first_az.zone_type == 'availability-zone'

0 comments on commit b1e6bfd

Please sign in to comment.