summaryrefslogtreecommitdiff
path: root/openstackclient/shell.py
diff options
context:
space:
mode:
authorTerryHowe <terrylhowe@gmail.com>2015-04-13 16:21:50 -0600
committerTerryHowe <terrylhowe@gmail.com>2015-04-13 16:21:50 -0600
commita0fe37e189948b74ee8c2f8ec529ca175efc8449 (patch)
treeeb1a258a517c4f085ab5ba5a55380698559bf5f9 /openstackclient/shell.py
parentd5f2c50c0f2de6d741f86113fc5260bdb7895102 (diff)
downloadpython-openstackclient-a0fe37e189948b74ee8c2f8ec529ca175efc8449.tar.gz
Add warning message if unknown version supplied
Print a warning message if an unknown api version is supplied. An attempt will be made to run the command anyway. Change-Id: Idec8e88fe9621f10ec4b7eecd90708fb3730f56f
Diffstat (limited to 'openstackclient/shell.py')
-rw-r--r--openstackclient/shell.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index 3cfd7312..ebc80c2a 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -247,6 +247,11 @@ class OpenStackShell(app.App):
if version_opt:
api = mod.API_NAME
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
version = '.v' + version_opt.replace('.', '_').split('_')[0]
cmd_group = 'openstack.' + api.replace('-', '_') + version