summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-10-19 06:59:19 +0000
committerGerrit Code Review <review@openstack.org>2017-10-19 06:59:19 +0000
commit128e5438b14e596fc01032cc3bd1210391e77e19 (patch)
treefe96bef34347c163bd637b75fa04624182e3ed16
parent745110e67416365f9c15d737829cd91e696a6194 (diff)
parent7a6ae8cefa4d2f1ed9a289e3124d3945781d36e9 (diff)
downloadoslo-db-128e5438b14e596fc01032cc3bd1210391e77e19.tar.gz
Merge "Remove property message for DBInvalidUnicodeParameter and InvalidSortKey"
-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 c5c7dcc..b7f38ed 100644
--- a/oslo_db/tests/sqlalchemy/test_utils.py
+++ b/oslo_db/tests/sqlalchemy/test_utils.py
@@ -205,17 +205,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')