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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user