summaryrefslogtreecommitdiff
path: root/keystoneclient/shell.py
diff options
context:
space:
mode:
authorTristan Cacqueray <tristan.cacqueray@enovance.com>2013-12-02 12:23:27 -0500
committerTristan Cacqueray <tristan.cacqueray@enovance.com>2013-12-02 12:23:27 -0500
commit17abb7b915e58122ab741606483361569ba5fcf2 (patch)
tree2993eec167bc4e87a659af29d4e981a7addacf02 /keystoneclient/shell.py
parent7abf8d2066b4236cc0638fd997f295ade66d5226 (diff)
downloadpython-keystoneclient-17abb7b915e58122ab741606483361569ba5fcf2.tar.gz
Warn user about unsupported API version
Prints a warning when the user tries to use an unsupported API. Also provides a test case to check it still does fall back to 2.0. Change-Id: Idabd150f52d27a9d065cf570f6367459126f98be Closes-bug: #1256987
Diffstat (limited to 'keystoneclient/shell.py')
-rw-r--r--keystoneclient/shell.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py
index c3a709f..ea09eb3 100644
--- a/keystoneclient/shell.py
+++ b/keystoneclient/shell.py
@@ -431,6 +431,10 @@ class OpenStackIdentityShell(object):
"2.0": shell_v2_0.CLIENT_CLASS,
}[version]
except KeyError:
+ if version:
+ msg = ('WARNING: unsupported identity-api-version %s, '
+ 'falling back to 2.0' % version)
+ print(msg)
return shell_v2_0.CLIENT_CLASS
def do_bash_completion(self, args):