From 0f176d8bc2010920842e1e6c1422aba05b9b5eb4 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Wed, 3 Dec 2014 01:24:47 +0000 Subject: [PATCH] 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 --- lib/nova | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/nova b/lib/nova index d5fe7ac48e..5db2f8fcd3 100644 --- a/lib/nova +++ b/lib/nova @@ -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