Merge "Add --os-endpoint-type cli optional argument"

This commit is contained in:
Jenkins
2015-07-03 02:48:47 +00:00
committed by Gerrit Code Review
15 changed files with 97 additions and 5 deletions

@ -208,6 +208,15 @@ class OpenStackShell(app.App):
help='Default domain ID, default=' +
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,
@ -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(