Skip to content

Commit b162a1d

Browse files
committed
Move default Keystone API version to v3
This patch sets Keystone v3 as default in services configuration files and in the openrc and stackrc scripts. Change-Id: I24546f02067ea23d088d383b85e3a78d7b43f165 Partially-Implements: bp keystonev3
1 parent ffb96b8 commit b162a1d

7 files changed

Lines changed: 16 additions & 12 deletions

File tree

lib/glance

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ function configure_glance {
205205
iniset $GLANCE_CACHE_CONF DEFAULT use_syslog $SYSLOG
206206
iniset $GLANCE_CACHE_CONF DEFAULT image_cache_dir $GLANCE_CACHE_DIR/
207207
iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_url
208-
iniset $GLANCE_CACHE_CONF DEFAULT auth_url $KEYSTONE_AUTH_URI/v2.0
208+
iniset $GLANCE_CACHE_CONF DEFAULT auth_url $KEYSTONE_AUTH_URI/v3
209209
iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_tenant_name
210210
iniset $GLANCE_CACHE_CONF DEFAULT admin_tenant_name $SERVICE_TENANT_NAME
211211
iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_user

lib/heat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function configure_heat {
167167
iniset $HEAT_CONF clients_keystone auth_uri $KEYSTONE_AUTH_URI
168168

169169
# ec2authtoken
170-
iniset $HEAT_CONF ec2authtoken auth_uri $KEYSTONE_SERVICE_URI/v2.0
170+
iniset $HEAT_CONF ec2authtoken auth_uri $KEYSTONE_SERVICE_URI/v3
171171

172172
# OpenStack API
173173
iniset $HEAT_CONF heat_api bind_port $HEAT_API_PORT

lib/nova_plugins/hypervisor-ironic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function configure_nova_hypervisor {
4747
# ironic section
4848
iniset $NOVA_CONF ironic admin_username admin
4949
iniset $NOVA_CONF ironic admin_password $ADMIN_PASSWORD
50-
iniset $NOVA_CONF ironic admin_url $KEYSTONE_AUTH_URI/v2.0
50+
iniset $NOVA_CONF ironic admin_url $KEYSTONE_AUTH_URI/v3
5151
iniset $NOVA_CONF ironic admin_tenant_name demo
5252
iniset $NOVA_CONF ironic api_endpoint $IRONIC_SERVICE_PROTOCOL://$IRONIC_HOSTPORT/v1
5353
}

lib/tempest

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ function configure_tempest {
259259
# Identity
260260
iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
261261
iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_URI_V3"
262+
iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v3}
262263
if [[ "$TEMPEST_HAS_ADMIN" == "True" ]]; then
263264
iniset $TEMPEST_CONFIG auth admin_username $ADMIN_USERNAME
264265
iniset $TEMPEST_CONFIG auth admin_password "$password"
@@ -269,10 +270,6 @@ function configure_tempest {
269270
if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
270271
# Only Identity v3 is available; then skip Identity API v2 tests
271272
iniset $TEMPEST_CONFIG identity-feature-enabled api_v2 False
272-
# In addition, use v3 auth tokens for running all Tempest tests
273-
iniset $TEMPEST_CONFIG identity auth_version v3
274-
else
275-
iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
276273
fi
277274

278275
if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then

openrc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,22 @@ KEYSTONE_AUTH_PROTOCOL=${KEYSTONE_AUTH_PROTOCOL:-$SERVICE_PROTOCOL}
7777
KEYSTONE_AUTH_HOST=${KEYSTONE_AUTH_HOST:-$SERVICE_HOST}
7878

7979
# Identity API version
80-
export OS_IDENTITY_API_VERSION=${IDENTITY_API_VERSION:-2.0}
80+
export OS_IDENTITY_API_VERSION=${IDENTITY_API_VERSION:-3}
8181

8282
# Authenticating against an OpenStack cloud using Keystone returns a **Token**
8383
# and **Service Catalog**. The catalog contains the endpoints for all services
8484
# the user/tenant has access to - including nova, glance, keystone, swift, ...
85-
# We currently recommend using the 2.0 *identity api*.
85+
# We currently recommend using the version 3 *identity api*.
8686
#
8787
export OS_AUTH_URL=$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:5000/v${OS_IDENTITY_API_VERSION}
8888

89+
# Currently, in order to use openstackclient with Identity API v3,
90+
# we need to set the domain which the user and project belong to.
91+
if [ "$OS_IDENTITY_API_VERSION" = "3" ]; then
92+
export OS_USER_DOMAIN_ID=${OS_USER_DOMAIN_ID:-"default"}
93+
export OS_PROJECT_DOMAIN_ID=${OS_PROJECT_DOMAIN_ID:-"default"}
94+
fi
95+
8996
# Set OS_CACERT to a default CA certificate chain if it exists.
9097
if [[ ! -v OS_CACERT ]] ; then
9198
DEFAULT_OS_CACERT=$INT_CA_DIR/ca-chain.pem

stackrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ elif [[ -f $RC_DIR/.localrc.auto ]]; then
130130
fi
131131

132132
# Configure Identity API version: 2.0, 3
133-
IDENTITY_API_VERSION=${IDENTITY_API_VERSION:-2.0}
133+
IDENTITY_API_VERSION=${IDENTITY_API_VERSION:-3}
134134

135135
# Set the option ENABLE_IDENTITY_V2 to True. It defines whether the DevStack
136136
# deployment will be deploying the Identity v2 pipelines. If this option is set

tools/create_userrc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ if [ -z "$OS_USERNAME" ]; then
133133
fi
134134

135135
if [ -z "$OS_AUTH_URL" ]; then
136-
export OS_AUTH_URL=http://localhost:5000/v2.0/
136+
export OS_AUTH_URL=http://localhost:5000/v3/
137137
fi
138138

139139
if [ -z "$OS_USER_DOMAIN_ID" -a -z "$OS_USER_DOMAIN_NAME" ]; then
@@ -236,7 +236,7 @@ export EC2_PRIVATE_KEY="$ec2_private_key"
236236
export EC2_USER_ID=42 #not checked by nova (can be a 12-digit id)
237237
export EUCALYPTUS_CERT="$ACCOUNT_DIR/cacert.pem"
238238
export NOVA_CERT="$ACCOUNT_DIR/cacert.pem"
239-
export OS_AUTH_TYPE=v2password
239+
export OS_AUTH_TYPE=v3password
240240
EOF
241241
if [ -n "$ADDPASS" ]; then
242242
echo "export OS_PASSWORD=\"$user_passwd\"" >>"$rcfile"

0 commit comments

Comments
 (0)