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: Id1eef7616150bb5d7dc7070d9b8898fbcc824bae Closes-Bug: #1627313
This commit is contained in:
parent
32592bc139
commit
839ca8d8db
|
@ -14,14 +14,8 @@
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
|
|
||||||
|
|
||||||
def import_versioned_module(version, submodule=None):
|
|
||||||
module = 'appcatalogclient.v%s' % version
|
|
||||||
if submodule:
|
|
||||||
module = '.'.join((module, submodule))
|
|
||||||
return importutils.import_module(module)
|
|
||||||
|
|
||||||
|
|
||||||
def Client(version, *args, **kwargs):
|
def Client(version, *args, **kwargs):
|
||||||
module = import_versioned_module(version, 'client')
|
module = importutils.import_versioned_module('appcatalogclient',
|
||||||
|
version, 'client')
|
||||||
client_class = getattr(module, 'Client')
|
client_class = getattr(module, 'Client')
|
||||||
return client_class(*args, **kwargs)
|
return client_class(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue