add options to support nova test matrix
This adds 2 devstack options:
NOVA_V2_LEGACY={True/False} which is whether we'd like to force the
/v2 endpoint to use the legacy v2.0 code base.
it also provides TEMPEST_COMPUTE_TYPE as an way to pass in which
service catalog entry we'd like to use for compute testing.
We also make v2.1 the default compute endpoint, as that's what we'd
like everyone to be testing and using. The other options will let us
build jobs that nova can run to ensure those APIs don't regress.
Change-Id: Ie6b7e4290d9a1d9789d04099b3b31c9a557bc22b
diff --git a/lib/nova b/lib/nova
index 6441a89..dcb4f13 100644
--- a/lib/nova
+++ b/lib/nova
@@ -64,6 +64,11 @@
# Expect to remove in L or M.
NOVA_API_VERSION=${NOVA_API_VERSION-default}
+# NOVA_V2_LEGACY defines whether we force the Nova v2.0 enpoint onto
+# the Nova v2.0 legacy code base. Remove this option once the Nova
+# v2.0 legacy codebase is removed.
+NOVA_V2_LEGACY=$(trueorfalse False NOVA_V2_LEGACY)
+
if is_suse; then
NOVA_WSGI_DIR=${NOVA_WSGI_DIR:-/srv/www/htdocs/nova}
else
@@ -317,6 +322,13 @@
if [[ "$NOVA_API_VERSION" == "v21default" ]]; then
sed -i s/": openstack_compute_api_v2$"/": openstack_compute_api_v21"/ "$NOVA_API_PASTE_INI"
fi
+
+ # For setting up an environment where v2.0 is running on the
+ # v2.0 legacy code base.
+ if [[ "$NOVA_V2_LEGACY" == "True" ]]; then
+ sed -i s@"^/v2: openstack_compute_api_v21_legacy_v2_compatible$"@"/v2: openstack_compute_api_legacy_v2"@ \
+ "$NOVA_API_PASTE_INI"
+ fi
fi
if is_service_enabled n-cpu; then
@@ -411,15 +423,16 @@
nova_api_url="$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST/compute"
fi
- get_or_create_service "nova" "compute" "Nova Compute Service"
- get_or_create_endpoint "compute" \
+ get_or_create_service "nova_legacy" "compute_legacy" \
+ "Nova Compute Service (Legacy 2.0)"
+ get_or_create_endpoint "compute_legacy" \
"$REGION_NAME" \
"$nova_api_url/v2/\$(tenant_id)s" \
"$nova_api_url/v2/\$(tenant_id)s" \
"$nova_api_url/v2/\$(tenant_id)s"
- get_or_create_service "novav21" "computev21" "Nova Compute Service V2.1"
- get_or_create_endpoint "computev21" \
+ get_or_create_service "nova" "compute" "Nova Compute Service"
+ get_or_create_endpoint "compute" \
"$REGION_NAME" \
"$nova_api_url/v2.1/\$(tenant_id)s" \
"$nova_api_url/v2.1/\$(tenant_id)s" \