diff --git a/plugins/module_utils/ec2.py b/plugins/module_utils/ec2.py index 289e106005e..26b15ea6ea1 100644 --- a/plugins/module_utils/ec2.py +++ b/plugins/module_utils/ec2.py @@ -1294,10 +1294,6 @@ class EC2PlacementGroupErrorHandler(AWSErrorHandler): def _is_missing(cls): return is_boto3_error_code("InvalidPlacementGroup.Unknown") - @classmethod - def _is_dry_run(cls): - return is_boto3_error_code("DryRunOperation") - @EC2PlacementGroupErrorHandler.list_error_handler("describe placement group", []) @AWSRetry.jittered_backoff() @@ -1309,8 +1305,8 @@ def describe_ec2_placement_groups( @EC2PlacementGroupErrorHandler.deletion_error_handler("delete placement group") @AWSRetry.jittered_backoff() -def delete_ec2_placement_group(client, group_name: str, dry_run: Optional[bool] = False) -> bool: - client.delete_placement_group(GroupName=group_name, DryRun=dry_run) +def delete_ec2_placement_group(client, group_name: str) -> bool: + client.delete_placement_group(GroupName=group_name) return True diff --git a/plugins/module_utils/errors.py b/plugins/module_utils/errors.py index b99b0ecaa45..38e9b380072 100644 --- a/plugins/module_utils/errors.py +++ b/plugins/module_utils/errors.py @@ -40,8 +40,6 @@ def wrapper(func): def handler(*args, **kwargs): try: return func(*args, **kwargs) - except cls._is_dry_run(): - return {"boto3_error_code": "DryRunOperation"} except botocore.exceptions.WaiterError as e: raise cls._CUSTOM_EXCEPTION(message=f"Timeout trying to {description}", exception=e) from e except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: