diff --git a/tests_new/integration_tests/aws_clients/iam.py b/tests_new/integration_tests/aws_clients/iam.py index 73050c748..1006d3871 100644 --- a/tests_new/integration_tests/aws_clients/iam.py +++ b/tests_new/integration_tests/aws_clients/iam.py @@ -16,8 +16,12 @@ def __init__(self, session=boto3.Session(), region=os.environ.get('AWS_REGION', self._region = region def get_role(self, role_name): - role = self._client.get_role(RoleName=role_name) - return role + try: + role = self._client.get_role(RoleName=role_name) + return role + except self._client.exceptions.NoSuchEntityException as e: + log.info(f'Error occurred: {e}') + return None def delete_role(self, role_name): self._client.delete_role(RoleName=role_name)