Merge "Add warning message if unknown version supplied"
This commit is contained in:
commit
520cae655e
@ -30,6 +30,9 @@ LOG = logging.getLogger(__name__)
|
|||||||
DEFAULT_COMPUTE_API_VERSION = '2'
|
DEFAULT_COMPUTE_API_VERSION = '2'
|
||||||
API_VERSION_OPTION = 'os_compute_api_version'
|
API_VERSION_OPTION = 'os_compute_api_version'
|
||||||
API_NAME = 'compute'
|
API_NAME = 'compute'
|
||||||
|
API_VERSIONS = {
|
||||||
|
"2": "novaclient.client",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def make_client(instance):
|
def make_client(instance):
|
||||||
|
@ -247,6 +247,11 @@ class OpenStackShell(app.App):
|
|||||||
if version_opt:
|
if version_opt:
|
||||||
api = mod.API_NAME
|
api = mod.API_NAME
|
||||||
self.api_version[api] = version_opt
|
self.api_version[api] = version_opt
|
||||||
|
if version_opt not in mod.API_VERSIONS:
|
||||||
|
self.log.warning(
|
||||||
|
"The %s version <%s> is not in supported versions <%s>"
|
||||||
|
% (api, version_opt,
|
||||||
|
', '.join(mod.API_VERSIONS.keys())))
|
||||||
# Command groups deal only with major versions
|
# Command groups deal only with major versions
|
||||||
version = '.v' + version_opt.replace('.', '_').split('_')[0]
|
version = '.v' + version_opt.replace('.', '_').split('_')[0]
|
||||||
cmd_group = 'openstack.' + api.replace('-', '_') + version
|
cmd_group = 'openstack.' + api.replace('-', '_') + version
|
||||||
|
Loading…
x
Reference in New Issue
Block a user