summaryrefslogtreecommitdiff
path: root/openstackclient/shell.py
diff options
context:
space:
mode:
authorTerryHowe <terrylhowe@gmail.com>2015-05-08 13:14:15 -0600
committerTerryHowe <terrylhowe@gmail.com>2015-07-18 06:28:09 -0600
commitb3335b3474e559d8afb0b7f86796fbb68a0687a8 (patch)
tree7fb6af85a7ae7f77c97af02012471984b4d77f3c /openstackclient/shell.py
parentfcadb16470832cdde2d090a19ebd20a3ad0d1476 (diff)
downloadpython-openstackclient-b3335b3474e559d8afb0b7f86796fbb68a0687a8.tar.gz
Do not set default versions in parsed args
Setting default versions in parsed args makes it so OCC cannot tell if the argument was parsed, an environment variable was set or it is just defaulted. In order to set api versions from OCC, it will have to be defaulted after processing OCC. Closes-Bug: #1453229 Change-Id: I4d065919397b783f3bdd4022c986c0234a7a16e6
Diffstat (limited to 'openstackclient/shell.py')
-rw-r--r--openstackclient/shell.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index edeffdfb..55b93b7a 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -297,7 +297,9 @@ class OpenStackShell(app.App):
# Loop through extensions to get API versions
for mod in clientmanager.PLUGIN_MODULES:
- version_opt = getattr(self.options, mod.API_VERSION_OPTION, None)
+ default_version = getattr(mod, 'DEFAULT_API_VERSION', None)
+ option = mod.API_VERSION_OPTION.replace('os_', '')
+ version_opt = self.cloud.config.get(option, default_version)
if version_opt:
api = mod.API_NAME
self.api_version[api] = version_opt