Create Congress Nova datasource with api_version 53/18953/1
authorCarlos Goncalves <carlos.goncalves@neclab.eu>
Thu, 18 Aug 2016 10:51:13 +0000 (11:51 +0100)
committerCarlos Goncalves <carlos.goncalves@neclab.eu>
Thu, 18 Aug 2016 11:09:22 +0000 (12:09 +0100)
The Congres Nova driver defaults to Nova API v2.0 but also supports
micro versions since Liberty release. This patch creates the Nova
datasource with the latest micro version available. This is useful for
scenarios such as invoking nova.services.force_down that was introduced
in v2.11.

https://bugs.launchpad.net/congress/+bug/1552220

JIRA: APEX-238

Change-Id: I0a60a1199e36da38e48aa647812dd6ee5543ce2b
Signed-off-by: Carlos Goncalves <carlos.goncalves@neclab.eu>
lib/post-install-functions.sh

index a7499fe..7df55cd 100755 (executable)
@@ -111,12 +111,17 @@ openstack endpoint delete \$swift_endpoint_id
 openstack service delete \$swift_service_id
 
 if [ "${deploy_options_array['congress']}" == 'True' ]; then
+    ds_configs="--config username=\$OS_USERNAME
+                --config tenant_name=\$OS_TENANT_NAME
+                --config password=\$OS_PASSWORD
+                --config auth_Url=\$OS_AUTH_URL"
     for s in nova neutronv2 ceilometer cinder glancev2 keystone; do
-        openstack congress datasource create \$s "\$s" \\
-            --config username=\$OS_USERNAME \\
-            --config tenant_name=\$OS_TENANT_NAME \\
-            --config password=\$OS_PASSWORD \\
-            --config auth_url=\$OS_AUTH_URL
+        ds_extra_configs=""
+        if [ "\$s" == "nova" ]; then
+            nova_micro_version=\$(nova version-list | grep CURRENT | awk '{print \$10}')
+            ds_extra_configs+="--config api_version="\$nova_micro_version"
+        fi
+        openstack congress datasource create \$s "\$s" \$ds_configs \$ds_extra_configs
     done
     openstack congress datasource create doctor "doctor"
 fi