summaryrefslogtreecommitdiff
path: root/glanceclient/common/utils.py
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-05-17 14:33:43 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-06-04 08:49:26 -0700
commit4b62848a4cbfe8d270a3386fcd43393bbefb973f (patch)
tree6d15a18a43c0f01d12d0812791eb2d0b0e635f5f /glanceclient/common/utils.py
parentb9b897252868732763de60d829b5c8de188adf38 (diff)
downloadpython-glanceclient-4b62848a4cbfe8d270a3386fcd43393bbefb973f.tar.gz
Add minimal support for the v2 API
This only allows you to run image-list, but sets up a framework that we can use to fill in the rest of the v2 functionality. * Related to bp glance-client-v2 Change-Id: I8827e36fdcf79fe402990a6d05898ec00cbd54c6
Diffstat (limited to 'glanceclient/common/utils.py')
-rw-r--r--glanceclient/common/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/glanceclient/common/utils.py b/glanceclient/common/utils.py
index 814622e..48f6b77 100644
--- a/glanceclient/common/utils.py
+++ b/glanceclient/common/utils.py
@@ -19,6 +19,7 @@ import uuid
import prettytable
from glanceclient.common import exceptions
+from glanceclient.openstack.common import importutils
# Decorator for cli-args
@@ -115,3 +116,10 @@ def env(*vars, **kwargs):
if value:
return value
return kwargs.get('default', '')
+
+
+def import_versioned_module(version, submodule=None):
+ module = 'glanceclient.v%s' % version
+ if submodule:
+ module = '.'.join((module, submodule))
+ return importutils.import_module(module)