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
This commit is contained in:
Brian Waldon
2012-05-17 14:33:43 -07:00
parent b9b8972528
commit 4b62848a4c
8 changed files with 131 additions and 7 deletions
+8
View File
@@ -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)