From 24aff3b796a5dc8e086a6593a85a27693f220fd3 Mon Sep 17 00:00:00 2001 From: scottda Date: Tue, 12 May 2015 13:21:35 +0000 Subject: [PATCH] Add --os-endpoint-type to match other services Cinder uses the parameter '--endpoint-type' but other services (Glance, Nova, Swift) use '--os-endpoint-type'. (Neutron has deprecated 'endpoint-type' in favor or 'os-endpoint-type' as well. '--endpoint-type' should be deprecated and 'os-endpoint-type' should be added. Change-Id: I0ac6573be35c86b9f764a39f1e60486d2345f51b Closes-Bug: #1453901 --- cinderclient/shell.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/cinderclient/shell.py b/cinderclient/shell.py index da562e1..9f0dc19 100644 --- a/cinderclient/shell.py +++ b/cinderclient/shell.py @@ -164,14 +164,24 @@ class OpenStackCinderShell(object): parser.add_argument('--endpoint-type', metavar='', + dest='os_endpoint_type', default=utils.env('CINDER_ENDPOINT_TYPE', default=DEFAULT_CINDER_ENDPOINT_TYPE), + help='DEPRECATED! Use --os-endpoint-type.') + parser.add_argument('--endpoint_type', + help=argparse.SUPPRESS) + + parser.add_argument('--os-endpoint-type', + metavar='', + default=utils.env('OS_ENDPOINT_TYPE', + default=utils.env('CINDER_ENDPOINT_TYPE', + default=DEFAULT_CINDER_ENDPOINT_TYPE)), help='Endpoint type, which is publicURL or ' 'internalURL. ' - 'Default=nova env[CINDER_ENDPOINT_TYPE] or ' + 'Default=env[OS_ENDPOINT_TYPE] or ' + 'nova env[CINDER_ENDPOINT_TYPE] or ' + DEFAULT_CINDER_ENDPOINT_TYPE + '.') - - parser.add_argument('--endpoint_type', + parser.add_argument('--os_endpoint_type', help=argparse.SUPPRESS) parser.add_argument('--os-volume-api-version', @@ -587,7 +597,7 @@ class OpenStackCinderShell(object): args.os_username, args.os_password, args.os_tenant_name, args.os_auth_url, args.os_region_name, args.os_tenant_id, - args.endpoint_type, args.insecure, + args.os_endpoint_type, args.insecure, args.service_type, args.service_name, args.volume_service_name, args.bypass_url, args.os_cacert, @@ -597,9 +607,6 @@ class OpenStackCinderShell(object): else: auth_plugin = None - if not endpoint_type: - endpoint_type = DEFAULT_CINDER_ENDPOINT_TYPE - if not service_type: service_type = DEFAULT_CINDER_SERVICE_TYPE service_type = utils.get_service_type(args.func) or service_type