From a2933a98f9fce7fa67a1c852377d2d2e84fa82ea Mon Sep 17 00:00:00 2001 From: ericzhou Date: Fri, 14 Mar 2014 23:54:40 +0800 Subject: [PATCH] Use the library method auth_uri_transform. Change-Id: I260ac1603a77ffe0390a5bd40aa98491f7e94f41 Imlements: blueprint move-keystone-authtoken-move-auth-uri-logic --- README.md | 1 + attributes/default.rb | 2 +- recipes/common.rb | 12 +----------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a8b83d7..1c8bc7c 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ Attributes for the Heat service are in the ['openstack']['orchestration'] namesp * `openstack['orchestration']['rpc_conn_pool_size']` - size of RPC connection pool * `openstack['orchestration']['rpc_response_timeout']` - seconds to wait for a response from call or multicall * `openstack['orchestration']['platform']` - hash of platform specific package/service names and options +* `openstack['orchestration']['api']['auth']['version']` - Select v2.0 or v3.0. Default v2.0. The auth API version used to interact with identity service. MQ attributes ------------- diff --git a/attributes/default.rb b/attributes/default.rb index 268cf55..7c1a917 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -40,7 +40,7 @@ default['openstack']['orchestration']['service_tenant_name'] = 'service' default['openstack']['orchestration']['service_user'] = 'heat' default['openstack']['orchestration']['service_role'] = 'admin' -default['openstack']['orchestration']['api']['auth']['version'] = 'v2.0' +default['openstack']['orchestration']['api']['auth']['version'] = node['openstack']['api']['auth']['version'] # If set, heat API service will bind to the address on this interface, # otherwise it will bind to the API endpoint's host. diff --git a/recipes/common.rb b/recipes/common.rb index 1ecac8e..febc832 100644 --- a/recipes/common.rb +++ b/recipes/common.rb @@ -59,17 +59,7 @@ heat_api_cloudwatch_endpoint = endpoint 'orchestration-api-cloudwatch' service_pass = get_password 'service', 'openstack-orchestration' -# TODO(jaypipes): Move this logic and stuff into the openstack-common -# library cookbook. -auth_uri = identity_endpoint.to_s -if node['openstack']['orchestration']['api']['auth']['version'] != 'v2.0' - # The auth_uri should contain /v2.0 in most cases, but if the - # auth_version is v3.0, we leave it off. This is only necessary - # for environments that need to support V3 non-default-domain - # tokens, which is really the only reason to set version to - # something other than v2.0 (the default) - auth_uri = auth_uri.gsub('/v2.0', '') -end +auth_uri = auth_uri_transform identity_endpoint.to_s, node['openstack']['orchestration']['api']['auth']['version'] mq_service_type = node['openstack']['mq']['orchestration']['service_type']