summaryrefslogtreecommitdiff
path: root/openstackclient/shell.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-07-03 02:48:47 +0000
committerGerrit Code Review <review@openstack.org>2015-07-03 02:48:47 +0000
commitee64c2fa6b9eb6f8d628e8899df39a4ee01c2bb3 (patch)
tree57e047252b843c67eef60fa4a1a8358dbac9f173 /openstackclient/shell.py
parentd80deaba41d09534a3f5a670957b4b0d035509b6 (diff)
parent5521e4c504c6a3a06f17a9e4f80444743aa293c7 (diff)
downloadpython-openstackclient-ee64c2fa6b9eb6f8d628e8899df39a4ee01c2bb3.tar.gz
Merge "Add --os-endpoint-type cli optional argument"
Diffstat (limited to 'openstackclient/shell.py')
-rw-r--r--openstackclient/shell.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index 4109b8bc..b4e5904c 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -209,6 +209,15 @@ class OpenStackShell(app.App):
DEFAULT_DOMAIN +
' (Env: OS_DEFAULT_DOMAIN)')
parser.add_argument(
+ '--os-endpoint-type',
+ metavar='<endpoint-type>',
+ dest='endpoint_type',
+ choices=['admin', 'public', 'internal'],
+ default=utils.env('OS_ENDPOINT_TYPE'),
+ help='Select an endpoint type.'
+ ' Valid endpoint types: [admin, public, internal].'
+ ' (Env: OS_ENDPOINT_TYPE)')
+ parser.add_argument(
'--timing',
default=False,
action='store_true',
@@ -254,7 +263,10 @@ class OpenStackShell(app.App):
self.options.project_name = tenant_name
# Do configuration file handling
- cc = cloud_config.OpenStackConfig()
+ # Ignore the default value of endpoint_type. Only if it is set later
+ # will it be used.
+ cc = cloud_config.OpenStackConfig(
+ override_defaults={'endpoint_type': None, })
self.log.debug("defaults: %s", cc.defaults)
self.cloud = cc.get_one_cloud(