mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Add minimum botocore and boto3 checking to AnsibleAWSModule (#41005)
* Add minimum botocore and boto3 checking to AnsibleAWSModule
This commit is contained in:
parent
2daf5f3edb
commit
7f8654d586
2 changed files with 29 additions and 4 deletions
|
@ -205,7 +205,6 @@ subnet:
|
|||
|
||||
import time
|
||||
import traceback
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
try:
|
||||
import botocore
|
||||
|
@ -255,7 +254,7 @@ def describe_subnets_with_backoff(client, **params):
|
|||
|
||||
|
||||
def waiter_params(module, params, start_time):
|
||||
if LooseVersion(botocore.__version__) >= "1.7.0":
|
||||
if not module.botocore_at_least("1.7.0"):
|
||||
remaining_wait_timeout = int(module.params['wait_timeout'] + start_time - time.time())
|
||||
params['WaiterConfig'] = {'Delay': 5, 'MaxAttempts': remaining_wait_timeout // 5}
|
||||
return params
|
||||
|
@ -578,7 +577,7 @@ def main():
|
|||
if module.params.get('assign_instances_ipv6') and not module.params.get('ipv6_cidr'):
|
||||
module.fail_json(msg="assign_instances_ipv6 is True but ipv6_cidr is None or an empty string")
|
||||
|
||||
if LooseVersion(botocore.__version__) < "1.7.0":
|
||||
if not module.botocore_at_least("1.7.0"):
|
||||
module.warn("botocore >= 1.7.0 is required to use wait_timeout for custom wait times")
|
||||
|
||||
region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue