From 4b62848a4cbfe8d270a3386fcd43393bbefb973f Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 17 May 2012 14:33:43 -0700 Subject: 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 --- glanceclient/common/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'glanceclient/common/utils.py') 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) -- cgit v1.2.1