Merge "Replacing data_processing with data-processing"

This commit is contained in:
Jenkins
2014-11-24 11:49:23 +00:00
committed by Gerrit Code Review
3 changed files with 6 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ The client constructor has a list of parameters to authenticate and locate Sahar
* auth_url - Keystone URL that will be used for authentication.
* sahara_url - Sahara REST API URL to communicate with.
* service_type - Sahara service name in Keystone catalog. (Default: data_processing)
* service_type - Sahara service name in Keystone catalog. (Default: data-processing)
* endpoint_type - Desired Sahara endpoint type. (Default: publicURL)
* username - Username for Keystone authentication.
* api_key - Password for Keystone authentication.

View File

@@ -54,6 +54,9 @@ class Client(object):
project_id=project_id,
project_name=project_name)
catalog = keystone.service_catalog.get_endpoints(service_type)
if service_type not in catalog:
service_type = service_type.replace('-', '_')
if service_type in catalog:
for e_type, endpoint in catalog.get(service_type)[0].items():
if str(e_type).lower() == str(endpoint_type).lower():

View File

@@ -57,7 +57,7 @@ from saharaclient import version
DEFAULT_API_VERSION = 'api'
DEFAULT_ENDPOINT_TYPE = 'publicURL'
DEFAULT_SERVICE_TYPE = 'data_processing'
DEFAULT_SERVICE_TYPE = 'data-processing'
logger = logging.getLogger(__name__)
@@ -279,7 +279,7 @@ class OpenStackSaharaShell(object):
parser.add_argument('--service-type',
metavar='<service-type>',
help='Defaults to data_processing for all '
help='Defaults to data-processing for all '
'actions.')
parser.add_argument('--service_type',
help=argparse.SUPPRESS)