Browse code

Set stack_user_domain config correctly

The recently merged patch which creates a domain for heat
fails to correctly set the domain ID in heat.conf, so move the
setting of the config option to immediately after we create the
domain. Also add the missing DEFAULT section identifier in the
iniset, and use OS_TOKEN instead of OS_SERVICE token, because
the stack.sh comment says this is exported for the openstackclient
workaround.

Change-Id: I912f774f1215d68cbcfe44229b371f318d92966a
Closes-Bug: #1283075

Steven Hardy authored on 2014/02/21 23:45:48
Showing 1 changed files
... ...
@@ -110,15 +110,6 @@ 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
-
122 113
     # paste_deploy
123 114
     [[ "$HEAT_STANDALONE" = "True" ]] && iniset $HEAT_CONF paste_deploy flavor standalone
124 115
 
... ...
@@ -211,9 +202,11 @@ function create_heat_accounts() {
211 211
     # Note we have to pass token/endpoint here because the current endpoint and
212 212
     # version negotiation in OSC means just --os-identity-api-version=3 won't work
213 213
     KS_ENDPOINT_V3="$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3"
214
-    openstack --os-token $OS_SERVICE_TOKEN --os-url=$KS_ENDPOINT_V3 \
214
+    D_ID=$(openstack --os-token $OS_TOKEN --os-url=$KS_ENDPOINT_V3 \
215 215
         --os-identity-api-version=3 domain create heat \
216
-        --description "Owns users and projects created by heat"
216
+        --description "Owns users and projects created by heat" \
217
+        | grep ' id ' | get_field 2)
218
+    iniset $HEAT_CONF DEFAULT stack_user_domain ${D_ID}
217 219
 }
218 220
 
219 221
 # Restore xtrace