Allow to specify the endpoint type to use

Not everybody will want to use publicURL, so let's make this configurable.

Change-Id: Ice85a8ef1083580d89285e83239de872939665af
Fixes: bug#1188469
This commit is contained in:
Julien Danjou 2013-07-03 15:53:55 +02:00
parent 65c4790303
commit e541fcb0d4
6 changed files with 15 additions and 3 deletions

View File

@ -77,7 +77,8 @@ class SingletonAlarmService(os_service.Service):
os_auth_url=auth_config.os_auth_url,
os_tenant_name=auth_config.os_tenant_name,
os_password=auth_config.os_password,
os_username=auth_config.os_username
os_username=auth_config.os_username,
endpoint_type=auth_config.os_endpoint_type,
)
return ceiloclient.get_client(2, **creds)

View File

@ -71,7 +71,8 @@ class Evaluator(object):
os_auth_url=auth_config.os_auth_url,
os_tenant_name=auth_config.os_tenant_name,
os_password=auth_config.os_password,
os_username=auth_config.os_username
os_username=auth_config.os_username,
endpoint_type=auth_config.os_endpoint_type,
)
self.api_client = ceiloclient.get_client(2, **creds)
return self.api_client

View File

@ -51,6 +51,7 @@ class Client(object):
api_key=cfg.CONF.service_credentials.os_password,
project_id=tenant,
auth_url=cfg.CONF.service_credentials.os_auth_url,
endpoint_type=cfg.CONF.service_credentials.os_endpoint_type,
no_cache=True)
def _with_flavor_and_image(self, instances):

View File

@ -62,6 +62,10 @@ CLI_OPTIONS = [
default=os.environ.get('OS_AUTH_URL',
'http://localhost:5000/v2.0'),
help='Auth URL to use for openstack service access'),
cfg.StrOpt('os-endpoint-type',
default=os.environ.get('OS_ENDPOINT_TYPE', 'publicURL'),
help='Type of endpoint in Identity service catalog to use for '
'communication with OpenStack services.'),
]
cfg.CONF.register_cli_opts(CLI_OPTIONS, group="service_credentials")

View File

@ -59,6 +59,7 @@ os_password admin Password
os_tenant_id Tenant ID to use for openstack service access
os_tenant_name admin Tenant name to use for openstack service access
os_auth_url http://localhost:5000/v2.0 Auth URL to use for openstack service access
os_endpoint_type publicURL Endpoint type in the catalog to use to access services
=============================== ==================================== ==============================================================
Keystone Middleware Authentication

View File

@ -583,6 +583,10 @@
# Auth URL to use for openstack service access (string value)
#os_auth_url=http://localhost:5000/v2.0
# Type of endpoint in Identity service catalog to use for
# communication with OpenStack services. (string value)
#os_endpoint_type=publicURL
[collector]
@ -631,4 +635,4 @@
#password=<None>
# Total option count: 121
# Total option count: 122