From 47823cce7c9b832b1f23eeb754e6ad4b9f212722 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 8 May 2024 19:27:03 +0900 Subject: [PATCH] Remove deprecated exceptions.check_message It was deprecated 5 years ago[1] and has been kept for enough long time. [1] 31f7fc6bb24995376bb74d7de6866f5bf2b322c8 Change-Id: Ie80b418c3eee3212006124be1eb4ee9f831f3d1d --- horizon/exceptions.py | 17 ----------------- requirements.txt | 1 - 2 files changed, 18 deletions(-) diff --git a/horizon/exceptions.py b/horizon/exceptions.py index de9b278e37..5c545273de 100644 --- a/horizon/exceptions.py +++ b/horizon/exceptions.py @@ -20,7 +20,6 @@ import logging import os import sys -from debtcollector import removals from django.core.management import color_style from django.utils import encoding from django.utils.translation import gettext_lazy as _ @@ -192,22 +191,6 @@ def error_color(msg): return color_style().ERROR_OUTPUT(msg) -@removals.remove(message='Use exceptions.handle() instead', version='17.2.0') -def check_message(keywords, message): - """Checks an exception for given keywords and raises an error if found. - - It raises a new ``ActionError`` with the desired message if the - keywords are found. This allows selective - control over API error messages. - """ - exc_type, exc_value, exc_traceback = sys.exc_info() - if set(str(exc_value).split(" ")).issuperset(set(keywords)): - exc_value.message = message - # NOTE: This function is intended to call inside an except clause. - # pylint: disable=misplaced-bare-raise - raise - - def handle_unauthorized(request, message, redirect, ignore, escalate, handled, force_silence, force_log, log_method, log_entry, log_level): diff --git a/requirements.txt b/requirements.txt index 9eed09a458..cae4b8d711 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,6 @@ pbr>=5.5.0 # Apache-2.0 # Horizon Core Requirements Babel>=2.6.0 # BSD -debtcollector>=1.2.0 # Apache-2.0 Django>=4.2,<4.3 # BSD django-compressor>=2.4.1 # MIT django-debreach>=1.4.2 # BSD License (2 clause)