From b714aa0379906e31ff038b4dc0cfc4b4a1307665 Mon Sep 17 00:00:00 2001 From: Alex Harvey Date: Sun, 27 Oct 2024 11:33:12 +1100 Subject: [PATCH] Refactor --- sceptre/diffing/stack_differ.py | 7 ------- tests/test_diffing/test_stack_differ.py | 11 ----------- 2 files changed, 18 deletions(-) diff --git a/sceptre/diffing/stack_differ.py b/sceptre/diffing/stack_differ.py index a8d269996..18577ef0b 100644 --- a/sceptre/diffing/stack_differ.py +++ b/sceptre/diffing/stack_differ.py @@ -197,13 +197,6 @@ def _create_deployed_stack_config( try: description = stack_actions.describe() except ClientError as err: - # Check for AWS access exceptions - if err.response["Error"]["Code"] == "ForbiddenException": - raise SceptreException( - "ForbiddenException: Confirm your current AWS profile is authenticated", - "and has the necessary access.", - ) - # This means the stack has not been deployed yet if err.response["Error"]["Message"].endswith("does not exist"): return None diff --git a/tests/test_diffing/test_stack_differ.py b/tests/test_diffing/test_stack_differ.py index f2e9887f4..a9d105c57 100644 --- a/tests/test_diffing/test_stack_differ.py +++ b/tests/test_diffing/test_stack_differ.py @@ -181,17 +181,6 @@ def expected_deployed_config(self): cloudformation_service_role=self.deployed_cloudformation_service_role, ) - def test__create_deployed_stack_config__wraps_aws_ForbiddenException(self): - def fail_with_ForbiddenException(): - raise ClientError( - {"Error": {"Code": "ForbiddenException", "Message": "No access"}}, - "describe", - ) - - self._describe_fn = fail_with_ForbiddenException - with pytest.raises(SceptreException): - self.differ._create_deployed_stack_config(self.actions) - def test_diff__compares_deployed_template_to_generated_template(self): self.differ.diff(self.actions)