Add NOVA_API_VERSIONS

This provides a mechanism for overriding v2 endpoint with v2.1 so that
tests can be run against a devstack to provide equivalency between the
APIs.

Change-Id: Iaaa530bda6bcdae75e86be8dbe572abe4396e8e9
This commit is contained in:
Ken'ichi Ohmichi 2014-12-03 01:24:47 +00:00 committed by Sean Dague
parent 47a81c9123
commit 0f176d8bc2

View File

@ -45,6 +45,12 @@ NOVA_FAKE_CONF=$NOVA_CONF_DIR/nova-fake.conf
NOVA_CELLS_DB=${NOVA_CELLS_DB:-nova_cell}
NOVA_API_PASTE_INI=${NOVA_API_PASTE_INI:-$NOVA_CONF_DIR/api-paste.ini}
# NOVA_API_VERSIONS valid options
# - default - setup API end points as nova does out of the box
# - v21default - make v21 the default on /v2
# NOTE(sdague): this is for transitional testing of the Nova v21 API.
# Expect to remove in L or M.
NOVA_API_VERSIONS=${NOVA_API_VERSIONS:-default}
if is_ssl_enabled_service "nova" || is_service_enabled tls-proxy; then
NOVA_SERVICE_PROTOCOL="https"
@ -263,6 +269,11 @@ function configure_nova {
# Get the sample configuration file in place
cp $NOVA_DIR/etc/nova/api-paste.ini $NOVA_CONF_DIR
# For testing v21 is equivalent to v2
if [[ "$NOVA_API_VERSION" == "v21default" ]]; then
sed -i s/": openstack_compute_api_v2$"/": openstack_compute_api_v21"/ "$NOVA_API_PASTE_INI"
fi
fi
if is_service_enabled n-cpu; then