Fixing glance-client and rally 89/27989/5
authorNikolas Hermanns <nikolas.hermanns@ericsson.com>
Fri, 3 Feb 2017 11:38:52 +0000 (06:38 -0500)
committerNikolas Hermanns <nikolas.hermanns@ericsson.com>
Mon, 6 Feb 2017 17:16:10 +0000 (12:16 -0500)
Since the project_id is not in the overcloudrc
glance clinet is failing.

Since os_tenant_name is not in overcloudrc
rally setup is failing.

Change-Id: Iaec4031d3419e8380fb8789288e587c44d600971
Signed-off-by: Nikolas Hermanns <nikolas.hermanns@ericsson.com>
lib/post-install-functions.sh

index 51287c4..55b4fe4 100755 (executable)
@@ -148,6 +148,22 @@ if [ "${deploy_options_array['congress']}" == 'NeverTrue' ]; then
       echo "WARN: Datsource: doctor could NOT be created"
     fi
 fi
+
+
+# Fix project_id and os_tenant_name not in overcloudrc
+# Deprecated openstack client does not need project_id
+# and os_tenant_name anymore but glance client and
+# Rally in generall does need it.
+# REMOVE when not needed in Rally/glance-client anymore.
+if ! grep -q  "OS_PROJECT_ID" ./overcloudrc;then
+    project_id=\$(openstack project list |grep admin|awk '{print \$2}')
+    echo "export OS_PROJECT_ID=\$project_id" >> ./overcloudrc
+fi
+if ! grep -q  "OS_TENANT_NAME" ./overcloudrc;then
+    echo "export OS_TENANT_NAME=admin" >> ./overcloudrc
+fi
+
+
 EOI
 
   # for virtual, we NAT external network through Undercloud