From 664905565f7efea624630664e7ac56aecd4d3246 Mon Sep 17 00:00:00 2001 From: Luong Anh Tuan Date: Wed, 2 Nov 2016 16:24:56 +0700 Subject: [PATCH] Make method import_versioned_module work Update function import_versioned_module in Oslo.utils 3.17 This patch update to meet new version. For more information: http://docs.openstack.org/developer/oslo.utils/history.html Change-Id: I9c3ba7acc9b04e766ae4e55f817a5c876a0e8752 Closes-Bug: #1627313 --- vitrageclient/client.py | 5 +++-- vitrageclient/common/utils.py | 8 -------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/vitrageclient/client.py b/vitrageclient/client.py index 2ba4e4d..9f54e93 100644 --- a/vitrageclient/client.py +++ b/vitrageclient/client.py @@ -13,12 +13,13 @@ import exc from keystoneauth1 import adapter as keystoneauth -from vitrageclient.common import utils +from oslo_utils import importutils # noinspection PyPep8Naming def Client(version, *args, **kwargs): - module = utils.import_versioned_module(version, 'client') + module = importutils.import_versioned_module('vitrageclient', + version, 'client') client_class = getattr(module, 'Client') return client_class(*args, **kwargs) diff --git a/vitrageclient/common/utils.py b/vitrageclient/common/utils.py index 98de026..44b1668 100644 --- a/vitrageclient/common/utils.py +++ b/vitrageclient/common/utils.py @@ -11,14 +11,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -from oslo_utils import importutils - - -def import_versioned_module(version, submodule=None): - module = 'vitrageclient.v%s' % version - if submodule: - module = '.'.join((module, submodule)) - return importutils.import_module(module) def args_to_dict(args, attrs):