From 866c2041de91b33177ce9a257abd0e11b1701fd2 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Wed, 16 Dec 2020 21:06:15 +0100 Subject: [PATCH] Use botocore_at_least rather than LooseVersion/StrictVersion directly (#280) * Use botocore_at_least rather than LooseVersion/StrictVersion directly * changelog This commit was initially merged in https://github.com/ansible-collections/community.aws See: https://github.com/ansible-collections/community.aws/commit/46102ffd4566291c5a31407ce7b14c78c2dfabaa --- plugins/modules/ec2_vpc_peer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/modules/ec2_vpc_peer.py b/plugins/modules/ec2_vpc_peer.py index 31f6ea203a7..c7efeff3829 100644 --- a/plugins/modules/ec2_vpc_peer.py +++ b/plugins/modules/ec2_vpc_peer.py @@ -221,7 +221,6 @@ except ImportError: pass # Handled by AnsibleAWSModule -import distutils.version import traceback from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule @@ -279,7 +278,7 @@ def create_peer_connection(client, module): params['VpcId'] = module.params.get('vpc_id') params['PeerVpcId'] = module.params.get('peer_vpc_id') if module.params.get('peer_region'): - if distutils.version.StrictVersion(botocore.__version__) < distutils.version.StrictVersion('1.8.6'): + if not module.botocore_at_least('1.8.6'): module.fail_json(msg="specifying peer_region parameter requires botocore >= 1.8.6") params['PeerRegion'] = module.params.get('peer_region') if module.params.get('peer_owner_id'):