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'):