Skip to content

Commit

Permalink
catch ImportError rather than Exception when testing Boto3 imports (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble authored and mandar242 committed Oct 23, 2024
1 parent 4b432a1 commit da6f030
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
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

0 comments on commit da6f030

Please sign in to comment.