summaryrefslogtreecommitdiff
path: root/openstackclient/compute
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/compute
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/compute')
-rw-r--r--openstackclient/compute/client.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/openstackclient/compute/client.py b/openstackclient/compute/client.py
index 6ae87b79..9dda32d6 100644
--- a/openstackclient/compute/client.py
+++ b/openstackclient/compute/client.py
@@ -19,7 +19,7 @@ from openstackclient.common import utils
LOG = logging.getLogger(__name__)
-DEFAULT_COMPUTE_API_VERSION = '2'
+DEFAULT_API_VERSION = '2'
API_VERSION_OPTION = 'os_compute_api_version'
API_NAME = 'compute'
API_VERSIONS = {
@@ -68,10 +68,8 @@ def build_option_parser(parser):
parser.add_argument(
'--os-compute-api-version',
metavar='<compute-api-version>',
- default=utils.env(
- 'OS_COMPUTE_API_VERSION',
- default=DEFAULT_COMPUTE_API_VERSION),
+ default=utils.env('OS_COMPUTE_API_VERSION'),
help='Compute API version, default=' +
- DEFAULT_COMPUTE_API_VERSION +
+ DEFAULT_API_VERSION +
' (Env: OS_COMPUTE_API_VERSION)')
return parser