summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsunguangning <sunguangning@unionpay.com>2017-09-11 14:29:31 +0800
committersunguangning <sunguangning@unionpay.com>2017-09-11 17:38:31 +0800
commit7a6ae8cefa4d2f1ed9a289e3124d3945781d36e9 (patch)
tree554f7364a5fabcf3f68242e476e03725251740b4
parent46fb5ac034ccdd9d34e31fc13e6e18ac95094d4b (diff)
downloadoslo-db-7a6ae8cefa4d2f1ed9a289e3124d3945781d36e9.tar.gz
Remove property message for DBInvalidUnicodeParameter and InvalidSortKey
Change-Id: Idace3cbe1ac3c454443d1c786054dc8ff0b0e8b5 Closes-Bug: #1714842
-rw-r--r--oslo_db/exception.py19
-rw-r--r--oslo_db/tests/sqlalchemy/test_utils.py6
2 files changed, 0 insertions, 25 deletions
diff --git a/oslo_db/exception.py b/oslo_db/exception.py
index c8da996..fcdfd4e 100644
--- a/oslo_db/exception.py
+++ b/oslo_db/exception.py
@@ -43,7 +43,6 @@ with `try/except` statement. This is required for consistent handling of
database errors.
"""
-import debtcollector.removals
import six
from oslo_db._i18n import _
@@ -188,13 +187,6 @@ class DBInvalidUnicodeParameter(Exception):
without encoding directive.
"""
- @debtcollector.removals.removed_property
- def message(self):
- # NOTE(rpodolyaka): provided for compatibility with python 3k, where
- # exceptions do not have .message attribute, while we used to have one
- # in this particular exception class. See LP #1542961 for details.
- return str(self)
-
def __init__(self):
super(DBInvalidUnicodeParameter, self).__init__(
_("Invalid Parameter: Encoding directive wasn't provided."))
@@ -221,10 +213,6 @@ class DBMigrationError(DbMigrationError):
super(DBMigrationError, self).__init__(message)
-debtcollector.removals.removed_class(DbMigrationError,
- replacement=DBMigrationError)
-
-
class DBConnectionError(DBError):
"""Wrapped connection specific exception.
@@ -250,13 +238,6 @@ class DBNotSupportedError(DBError):
class InvalidSortKey(Exception):
"""A sort key destined for database query usage is invalid."""
- @debtcollector.removals.removed_property
- def message(self):
- # NOTE(rpodolyaka): provided for compatibility with python 3k, where
- # exceptions do not have .message attribute, while we used to have one
- # in this particular exception class. See LP #1542961 for details.
- return str(self)
-
def __init__(self, key=None):
super(InvalidSortKey, self).__init__(
_("Sort key supplied is invalid: %s") % key)
diff --git a/oslo_db/tests/sqlalchemy/test_utils.py b/oslo_db/tests/sqlalchemy/test_utils.py
index ad26ee4..aae9c8b 100644
--- a/oslo_db/tests/sqlalchemy/test_utils.py
+++ b/oslo_db/tests/sqlalchemy/test_utils.py
@@ -203,17 +203,11 @@ class TestPaginateQuery(test_base.BaseTestCase):
str(exception.InvalidSortKey()))
self.assertEqual("Sort key supplied is invalid: lol",
str(exception.InvalidSortKey("lol")))
- self.assertEqual("Sort key supplied is invalid: lol",
- exception.InvalidSortKey("lol").message)
def test_invalid_unicode_paramater_str(self):
self.assertEqual(
"Invalid Parameter: Encoding directive wasn't provided.",
str(exception.DBInvalidUnicodeParameter()))
- self.assertEqual(
- "Invalid Parameter: Encoding directive wasn't provided.",
- exception.DBInvalidUnicodeParameter().message
- )
def test_paginate_query_attribute_error(self):
sqlalchemy.asc(self.model.user_id).AndReturn('asc')