Browse code

Merge "Add support for creating heat stack domain"

Jenkins authored on 2014/02/18 21:08:37
Showing 2 changed files
... ...
@@ -110,6 +110,15 @@ function configure_heat() {
110 110
     iniset $HEAT_CONF ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0
111 111
     iniset $HEAT_CONF ec2authtoken keystone_ec2_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ec2tokens
112 112
 
113
+    # stack user domain
114
+    # Note we have to pass token/endpoint here because the current endpoint and
115
+    # version negotiation in OSC means just --os-identity-api-version=3 won't work
116
+    KS_ENDPOINT_V3="$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3"
117
+    D_ID=$(openstack --os-token $OS_SERVICE_TOKEN --os-url=$KS_ENDPOINT_V3 \
118
+        --os-identity-api-version=3 domain show heat \
119
+        | grep ' id ' | get_field 2)
120
+    iniset $HEAT_CONF stack_user_domain ${D_ID}
121
+
113 122
     # paste_deploy
114 123
     [[ "$HEAT_STANDALONE" = "True" ]] && iniset $HEAT_CONF paste_deploy flavor standalone
115 124
 
... ...
@@ -196,6 +205,17 @@ function disk_image_create {
196 196
     upload_image "http://localhost/$output.qcow2" $TOKEN
197 197
 }
198 198
 
199
+# create_heat_accounts() - Set up common required heat accounts
200
+# Note this is in addition to what is in files/keystone_data.sh
201
+function create_heat_accounts() {
202
+    # Note we have to pass token/endpoint here because the current endpoint and
203
+    # version negotiation in OSC means just --os-identity-api-version=3 won't work
204
+    KS_ENDPOINT_V3="$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3"
205
+    openstack --os-token $OS_SERVICE_TOKEN --os-url=$KS_ENDPOINT_V3 \
206
+        --os-identity-api-version=3 domain create heat \
207
+        --description "Owns users and projects created by heat"
208
+}
209
+
199 210
 # Restore xtrace
200 211
 $XTRACE
201 212
 
... ...
@@ -941,6 +941,10 @@ if is_service_enabled key; then
941 941
         create_swift_accounts
942 942
     fi
943 943
 
944
+    if is_service_enabled heat; then
945
+        create_heat_accounts
946
+    fi
947
+
944 948
     # ``keystone_data.sh`` creates services, admin and demo users, and roles.
945 949
     ADMIN_PASSWORD=$ADMIN_PASSWORD SERVICE_TENANT_NAME=$SERVICE_TENANT_NAME SERVICE_PASSWORD=$SERVICE_PASSWORD \
946 950
     SERVICE_TOKEN=$SERVICE_TOKEN SERVICE_ENDPOINT=$SERVICE_ENDPOINT SERVICE_HOST=$SERVICE_HOST \