diff options
author | ekudryashova <ekudryashova@mirantis.com> | 2014-01-21 14:31:50 +0200 |
---|---|---|
committer | ekudryashova <ekudryashova@mirantis.com> | 2014-01-21 14:31:50 +0200 |
commit | 91c9e0e711fd47b5886581363e24df0d22b90a61 (patch) | |
tree | 33c48a4993010fc3b522d2a683f241675d4ac46c | |
parent | 5e2522e3d4774f1e79a38459893f995d17163642 (diff) | |
download | oslo-utils-91c9e0e711fd47b5886581363e24df0d22b90a61.tar.gz |
Deleted duplicated method in cliutils.
Method import_class in cliutils duplicates method in importutils module,
and method import_versioned_module is more related to import tools,
so it is moved in appropriate module.
bp common-client-library-2
Change-Id: I7b8892b2885f8b05a8106300371481209e99749d
-rw-r--r-- | openstack/common/importutils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openstack/common/importutils.py b/openstack/common/importutils.py index 4fd9ae2..52e2e72 100644 --- a/openstack/common/importutils.py +++ b/openstack/common/importutils.py @@ -58,6 +58,13 @@ def import_module(import_str): return sys.modules[import_str] +def import_versioned_module(version, submodule=None): + module = 'oslo.v%s' % version + if submodule: + module = '.'.join((module, submodule)) + return import_module(module) + + def try_import(import_str, default=None): """Try to import a module and if it fails return default.""" try: |