Skip to content

Commit d986c59

Browse files
Jenkinsopenstack-gerrit
Jenkins
authored andcommitted
Merge "Honor the flag for Identity v3 API only jobs"
2 parents cfdb6fa + 3fd71d6 commit d986c59

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

lib/horizon

+8-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,14 @@ function init_horizon {
9797
_horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_DEFAULT_ROLE \"Member\"
9898

9999
_horizon_config_set $local_settings "" OPENSTACK_HOST \"${KEYSTONE_SERVICE_HOST}\"
100-
_horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_URL "\"${KEYSTONE_SERVICE_PROTOCOL}://${KEYSTONE_SERVICE_HOST}:${KEYSTONE_SERVICE_PORT}/v2.0\""
100+
101+
if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
102+
# Only Identity v3 API is available; then use it with v3 auth tokens
103+
_horizon_config_set $local_settings "" OPENSTACK_API_VERSIONS {\"identity\":\"v3\"}
104+
_horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_URL "\"${KEYSTONE_SERVICE_PROTOCOL}://${KEYSTONE_SERVICE_HOST}:${KEYSTONE_SERVICE_PORT}/v3\""
105+
else
106+
_horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_URL "\"${KEYSTONE_SERVICE_PROTOCOL}://${KEYSTONE_SERVICE_HOST}:${KEYSTONE_SERVICE_PORT}/v2.0\""
107+
fi
101108

102109
if [ -f $SSL_BUNDLE_FILE ]; then
103110
_horizon_config_set $local_settings "" OPENSTACK_SSL_CACERT \"${SSL_BUNDLE_FILE}\"

lib/keystone

+6
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ function configure_keystone {
197197
KEYSTONE_PASTE_INI="$KEYSTONE_CONF"
198198
fi
199199

200+
if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
201+
# Only Identity v3 API should be available; then disable v2 pipelines
202+
inidelete $KEYSTONE_PASTE_INI composite:main \\/v2.0
203+
inidelete $KEYSTONE_PASTE_INI composite:admin \\/v2.0
204+
fi
205+
200206
configure_keystone_extensions
201207

202208
# Rewrite stock ``keystone.conf``

lib/tempest

+9-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,15 @@ function configure_tempest {
310310
iniset $TEMPEST_CONFIG identity admin_tenant_id $ADMIN_TENANT_ID
311311
iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME
312312
fi
313-
iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
313+
if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
314+
# Only Identity v3 is available; then skip Identity API v2 tests
315+
iniset $TEMPEST_CONFIG identity-feature-enabled v2_api False
316+
# In addition, use v3 auth tokens for running all Tempest tests
317+
iniset $TEMPEST_CONFIG identity auth_version v3
318+
else
319+
iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
320+
fi
321+
314322
if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
315323
iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE
316324
fi

stackrc

+16-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ TEMPEST_SERVICES=""
8787
# Set the default Nova APIs to enable
8888
NOVA_ENABLED_APIS=ec2,osapi_compute,metadata
8989

90-
# Configure Identity API version: 2.0, 3
91-
IDENTITY_API_VERSION=2.0
92-
9390
# Whether to use 'dev mode' for screen windows. Dev mode works by
9491
# stuffing text into the screen windows so that a developer can use
9592
# ctrl-c, up-arrow, enter to restart the service. Starting services
@@ -106,6 +103,22 @@ elif [[ -f $RC_DIR/.localrc.auto ]]; then
106103
source $RC_DIR/.localrc.auto
107104
fi
108105

106+
# Configure Identity API version: 2.0, 3
107+
IDENTITY_API_VERSION=${IDENTITY_API_VERSION:-2.0}
108+
109+
# Set the option ENABLE_IDENTITY_V2 to True. It defines whether the DevStack
110+
# deployment will be deploying the Identity v2 pipelines. If this option is set
111+
# to ``False``, DevStack will: i) disable Identity v2; ii) configure Tempest to
112+
# skip Identity v2 specific tests; and iii) configure Horizon to use Identity
113+
# v3. When this option is set to ``False``, the option IDENTITY_API_VERSION
114+
# will to be set to ``3`` in order to make DevStack register the Identity
115+
# endpoint as v3. This flag is experimental and will be used as basis to
116+
# identify the projects which still have issues to operate with Identity v3.
117+
ENABLE_IDENTITY_V2=$(trueorfalse True ENABLE_IDENTITY_V2)
118+
if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
119+
IDENTITY_API_VERSION=3
120+
fi
121+
109122
# Enable use of Python virtual environments. Individual project use of
110123
# venvs are controlled by the PROJECT_VENV array; every project with
111124
# an entry in the array will be installed into the named venv.

0 commit comments

Comments
 (0)