]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Remove unnecessary keystone scripts
authorJeff Peeler <jpeeler@redhat.com>
Sat, 29 Sep 2012 00:08:35 +0000 (20:08 -0400)
committerJeff Peeler <jpeeler@redhat.com>
Tue, 9 Oct 2012 15:51:56 +0000 (16:51 +0100)
Make remaining keystone script check installed version of Nova and use
proper arguments to keystone.

closes #252

Change-Id: Ie4709891c7ca89d73390a3474e3d10beab449395
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
bin/heat-keystone-setup
docs/GettingStarted.rst
tools/heat-keystone-service [deleted file]
tools/heat-keystone-service-devstack [deleted file]

index 0c3d688d0fa46f3cb99c8d091fa7cd07603c3448..b241442d6eeb81c9491759f04e0c4bc62aa61ff8 100755 (executable)
@@ -45,9 +45,17 @@ HEAT_USER=$(get_id keystone user-create --name=heat \
                                         --tenant_id $SERVICE_TENANT \
                                         --email=heat@example.com)
 echo HEAT_USER $HEAT_USER
-keystone user-role-add --tenant_id $SERVICE_TENANT \
-                       --user_id $HEAT_USER \
-                       --role_id $ADMIN_ROLE
+
+ver=`nova-manage version list | cut -d . -f1`
+if [ $ver -lt 2013 ]; then
+    keystone user-role-add --tenant_id $SERVICE_TENANT \
+                           --user $HEAT_USER \
+                           --role $ADMIN_ROLE
+else
+    keystone user-role-add --tenant_id $SERVICE_TENANT \
+                           --user_id $HEAT_USER \
+                           --role_id $ADMIN_ROLE
+fi
 
 keystone endpoint-create --region RegionOne --service_id $HEAT_SERVICE \
     --publicurl 'http://localhost:8000/v1' \
index 441f2a5972787dc9ddd1446ee8b9ba39b218881f..461b100315c17b712c975c4743f650564a027f4f 100644 (file)
@@ -127,9 +127,9 @@ Register heat with keystone
 
 ::
 
-    sudo -E ./tools/heat-keystone-service
+    sudo -E ./bin/heat-keystone-setup
 
-Note: The ``-E`` option to ``sudo`` preserves the environment, specifically the keystone credentials, when ``heat-keystone-service`` is run as root. This script needs to run as root in order to read the admin password.
+Note: The ``-E`` option to ``sudo`` preserves the environment, specifically the keystone credentials, when ``heat-keystone-setup`` is run as root. This script needs to run as root in order to read the admin password.
 
 Register a SSH key-pair with OpenStack Nova
 -------------------------------------------
diff --git a/tools/heat-keystone-service b/tools/heat-keystone-service
deleted file mode 100755 (executable)
index 842b9b1..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/bash
-
-set +e
-
-function get_id () {
-    echo `"$@" | grep ' id ' | awk '{print $4}'`
-}
-
-KEYSTONE_CONF=${KEYSTONE_CONF:-/etc/keystone/keystone.conf}
-
-# Extract some info from Keystone's configuration file
-if [[ -r "$KEYSTONE_CONF" ]]; then
-    CONFIG_SERVICE_TOKEN=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_token= | cut -d'=' -f2)
-    CONFIG_ADMIN_PORT=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_port= | cut -d'=' -f2)
-fi
-
-export SERVICE_TOKEN=${SERVICE_TOKEN:-$CONFIG_SERVICE_TOKEN}
-export SERVICE_ENDPOINT=${SERVICE_ENDPOINT:-http://127.0.0.1:${CONFIG_ADMIN_PORT:-35357}/v2.0}
-if [[ -z "$SERVICE_TOKEN" ]]; then
-    echo "No service token found."
-    echo "Set SERVICE_TOKEN manually from keystone.conf admin_token."
-    exit 1
-fi
-
-ADMIN_ROLE=$(keystone role-list | grep '\badmin\b' | awk '{ print $2 }')
-SERVICE_TENANT=$(keystone tenant-list | grep service | cut -d\| -f2)
-SERVICE_PASSWORD=${SERVICE_PASSWORD:-$OS_PASSWORD}
-if [[ "$SERVICE_PASSWORD" == "$OS_PASSWORD" ]]; then
-    echo "Using the OS_PASSWORD for the SERVICE_PASSWORD."
-    echo "I hope this works"
-fi
-
-echo ADMIN_ROLE $ADMIN_ROLE
-echo SERVICE_TENANT $SERVICE_TENANT
-echo SERVICE_PASSWORD $SERVICE_PASSWORD
-echo SERVICE_TOKEN $SERVICE_TOKEN
-
-
-# Services
-HEAT_SERVICE=$(get_id \
-keystone service-create --name=heat \
-                        --type=orchestration \
-                        --description="Heat Service")
-HEAT_USER=$(get_id keystone user-create --name=heat \
-                                        --pass="$SERVICE_PASSWORD" \
-                                        --tenant_id $SERVICE_TENANT \
-                                        --email=heat@example.com)
-echo HEAT_USER $HEAT_USER
-keystone user-role-add --tenant_id $SERVICE_TENANT \
-                       --user $HEAT_USER \
-                       --role $ADMIN_ROLE
-
-keystone endpoint-create --region RegionOne --service_id $HEAT_SERVICE \
-    --publicurl 'http://localhost:8000/v1' \
-    --adminurl 'http://localhost:8000/v1' \
-    --internalurl 'http://localhost:8000/v1'
-
diff --git a/tools/heat-keystone-service-devstack b/tools/heat-keystone-service-devstack
deleted file mode 100755 (executable)
index 65dd7f5..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-
-set +e
-
-function get_id () {
-    echo `"$@" | grep ' id ' | awk '{print $4}'`
-}
-
-KEYSTONE_CONF=${KEYSTONE_CONF:-/etc/keystone/keystone.conf}
-
-# Extract some info from Keystone's configuration file
-if [[ -r "$KEYSTONE_CONF" ]]; then
-    CONFIG_SERVICE_TOKEN=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_token= | cut -d'=' -f2)
-    CONFIG_ADMIN_PORT=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_port= | cut -d'=' -f2)
-fi
-
-export SERVICE_TOKEN=${SERVICE_TOKEN:-$CONFIG_SERVICE_TOKEN}
-export SERVICE_ENDPOINT=${SERVICE_ENDPOINT:-http://127.0.0.1:${CONFIG_ADMIN_PORT:-35357}/v2.0}
-if [[ -z "$SERVICE_TOKEN" ]]; then
-    echo "No service token found."
-    echo "Set SERVICE_TOKEN manually from keystone.conf admin_token."
-    exit 1
-fi
-
-ADMIN_ROLE=$(keystone role-list | grep '\badmin\b' | awk '{ print $2 }')
-SERVICE_TENANT=$(keystone tenant-list | grep service | cut -d\| -f2)
-SERVICE_PASSWORD=${SERVICE_PASSWORD:-$OS_PASSWORD}
-if [[ "$SERVICE_PASSWORD" == "$OS_PASSWORD" ]]; then
-    echo "Using the OS_PASSWORD for the SERVICE_PASSWORD."
-    echo "I hope this works"
-fi
-
-echo ADMIN_ROLE $ADMIN_ROLE
-echo SERVICE_TENANT $SERVICE_TENANT
-echo SERVICE_PASSWORD $SERVICE_PASSWORD
-echo SERVICE_TOKEN $SERVICE_TOKEN
-
-
-# Services
-HEAT_SERVICE=$(get_id \
-keystone service-create --name=heat \
-                        --type=orchestration \
-                        --description="Heat Service")
-HEAT_USER=$(get_id keystone user-create --name=heat \
-                                        --pass="$SERVICE_PASSWORD" \
-                                        --tenant_id $SERVICE_TENANT \
-                                        --email=heat@example.com)
-echo HEAT_USER $HEAT_USER
-keystone user-role-add --tenant_id $SERVICE_TENANT \
-                       --user_id $HEAT_USER \
-                       --role_id $ADMIN_ROLE
-