diff options
author | Joshua Harlow <harlowja@gmail.com> | 2015-06-06 22:55:06 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@gmail.com> | 2015-06-06 22:55:06 -0700 |
commit | e0f0608db5e55106530d18e127572f45aa2ec66d (patch) | |
tree | 07b88c82d3764989ab805a15e09f4e1cec9cdaaa /oslo_db | |
parent | 42de3f6b49f1e51ee9deba585d782ca12e3483dd (diff) | |
download | oslo-db-e0f0608db5e55106530d18e127572f45aa2ec66d.tar.gz |
Replace utils method with oslo.utils reflection provided one1.11.0
Change-Id: Ife14a6acd01a16c4b1092b43fb94942db0e03036
Diffstat (limited to 'oslo_db')
-rw-r--r-- | oslo_db/sqlalchemy/test_base.py | 5 | ||||
-rw-r--r-- | oslo_db/sqlalchemy/utils.py | 25 |
2 files changed, 3 insertions, 27 deletions
diff --git a/oslo_db/sqlalchemy/test_base.py b/oslo_db/sqlalchemy/test_base.py index 8cab2ac..362f685 100644 --- a/oslo_db/sqlalchemy/test_base.py +++ b/oslo_db/sqlalchemy/test_base.py @@ -25,12 +25,13 @@ except ImportError: import os + +from oslo_utils import reflection import six from oslo_db import exception from oslo_db.sqlalchemy import provision from oslo_db.sqlalchemy import session -from oslo_db.sqlalchemy import utils class DbFixture(fixtures.Fixture): @@ -192,7 +193,7 @@ def backend_specific(*dialects): if self.engine.name not in dialects: msg = ('The test "%s" can be run ' 'only on %s. Current engine is %s.') - args = (utils.get_callable_name(f), ' '.join(dialects), + args = (reflection.get_callable_name(f), ' '.join(dialects), self.engine.name) self.skip(msg % args) else: diff --git a/oslo_db/sqlalchemy/utils.py b/oslo_db/sqlalchemy/utils.py index b4e0664..4266ba3 100644 --- a/oslo_db/sqlalchemy/utils.py +++ b/oslo_db/sqlalchemy/utils.py @@ -54,31 +54,6 @@ LOG = logging.getLogger(__name__) _DBURL_REGEX = re.compile(r"[^:]+://([^:]+):([^@]+)@.+") -def get_callable_name(function): - # TODO(harlowja): Replace this once - # it is possible to use https://review.openstack.org/#/c/122495/ which is - # a more complete and expansive module that does a similar thing... - try: - method_self = six.get_method_self(function) - except AttributeError: - method_self = None - if method_self is not None: - if isinstance(method_self, six.class_types): - im_class = method_self - else: - im_class = type(method_self) - try: - parts = (im_class.__module__, function.__qualname__) - except AttributeError: - parts = (im_class.__module__, im_class.__name__, function.__name__) - else: - try: - parts = (function.__module__, function.__qualname__) - except AttributeError: - parts = (function.__module__, function.__name__) - return '.'.join(parts) - - def sanitize_db_url(url): match = _DBURL_REGEX.match(url) if match: |