Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catch ImportError rather than Exception when testing Boto3 imports #267

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions plugins/modules/aws_direct_connect_confirm_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@

try:
from botocore.exceptions import BotoCoreError, ClientError
except Exception:
pass
# handled by imported AnsibleAWSModule
except ImportError:
pass # handled by imported AnsibleAWSModule

retry_params = {"tries": 10, "delay": 5, "backoff": 1.2, "catch_extra_error_codes": ["DirectConnectClientException"]}

Expand Down
5 changes: 2 additions & 3 deletions plugins/modules/aws_direct_connect_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,8 @@

try:
from botocore.exceptions import BotoCoreError, ClientError
except Exception:
pass
# handled by imported AnsibleAWSModule
except ImportError:
pass # handled by imported AnsibleAWSModule

retry_params = {"tries": 10, "delay": 5, "backoff": 1.2, "catch_extra_error_codes": ["DirectConnectClientException"]}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@

try:
import botocore
except Exception:
except ImportError:
pass # Handled by AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_s3_cors.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

try:
from botocore.exceptions import ClientError, BotoCoreError
except Exception:
except ImportError:
pass # Handled by AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
Expand Down
5 changes: 2 additions & 3 deletions plugins/modules/ec2_transit_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,8 @@

try:
from botocore.exceptions import BotoCoreError, ClientError
except Exception:
pass
# handled by imported AnsibleAWSModule
except ImportError:
pass # handled by imported AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from time import sleep, time
Expand Down
5 changes: 2 additions & 3 deletions plugins/modules/ec2_transit_gateway_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,8 @@

try:
from botocore.exceptions import BotoCoreError, ClientError
except Exception:
pass
# handled by imported AnsibleAWSModule
except ImportError:
pass # handled by imported AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import (
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/lambda_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@

try:
from botocore.exceptions import ClientError
except Exception:
except ImportError:
pass # caught by AnsibleAWSModule


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/rds_snapshot_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@

try:
import botocore
except Exception:
except ImportError:
pass # caught by AnsibleAWSModule


Expand Down