Skip to content

Commit

Permalink
Use botocore_at_least rather than LooseVersion/StrictVersion directly (
Browse files Browse the repository at this point in the history
…ansible-collections#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: ansible-collections/community.aws@46102ff
  • Loading branch information
tremble authored and alinabuzachis committed Oct 23, 2024
1 parent 152ae17 commit 46546c1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugins/modules/ec2_vpc_peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'):
Expand Down

0 comments on commit 46546c1

Please sign in to comment.