Try removing boto package again

This commit is contained in:
Ben Thorner
2021-10-29 10:51:22 +01:00
parent efe4c6f06e
commit 29c92a9e54
4 changed files with 4 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ import functools
import uuid
from datetime import datetime
from boto.exception import SQSError
import botocore
from flask import abort, current_app, jsonify, request
from gds_metrics import Histogram
from notifications_utils.recipients import try_validate_and_format_phone_number
@@ -232,7 +232,7 @@ def process_sms_or_email_notification(
reply_to_text=reply_to_text
)
return resp
except SQSError:
except botocore.exceptions.ClientError:
# if SQS cannot put the task on the queue, it's probably because the notification body was too long and it
# went over SQS's 256kb message limit. If so, we
current_app.logger.info(

View File

@@ -1,7 +1,6 @@
# Run `make freeze-requirements` to update requirements.txt
# with package version changes made in requirements-app.txt
boto==2.49.0 # notify-api crashes in PaaS without this
cffi==1.14.5
celery[sqs]==5.1.2
docopt==0.6.2

View File

@@ -3,7 +3,6 @@
# Run `make freeze-requirements` to update requirements.txt
# with package version changes made in requirements-app.txt
boto==2.49.0 # notify-api crashes in PaaS without this
cffi==1.14.5
celery[sqs]==5.1.2
docopt==0.6.2

View File

@@ -2,8 +2,8 @@ import uuid
from unittest import mock
from unittest.mock import call
import botocore
import pytest
from boto.exception import SQSError
from flask import current_app, json
from app.dao import templates_dao
@@ -1074,7 +1074,7 @@ def test_post_notifications_saves_email_or_sms_normally_if_saving_to_queue_fails
):
save_task = mocker.patch(
f"app.celery.tasks.save_api_{notification_type}.apply_async",
side_effect=SQSError({'some': 'json'}, 'some opname')
side_effect=botocore.exceptions.ClientError({'some': 'json'}, 'some opname')
)
mock_send_task = mocker.patch(f'app.celery.provider_tasks.deliver_{notification_type}.apply_async')