Browse code

clean up service token

Vishvananda Ishaya authored on 2011/11/07 04:18:26
Showing 2 changed files
... ...
@@ -124,4 +124,4 @@ auth_host = 127.0.0.1
124 124
 auth_port = 35357
125 125
 auth_protocol = http
126 126
 auth_uri = http://127.0.0.1:5000/
127
-admin_token = 999888777666
127
+admin_token = %SERVICE_TOKEN%
... ...
@@ -562,15 +562,12 @@ fi
562 562
 # ----
563 563
 
564 564
 if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
565
-    # We are going to use the sample http middleware configuration from the
566
-    # keystone project to launch nova.  This paste config adds the configuration
567
-    # required for nova to validate keystone tokens - except we need to switch
568
-    # the config to use our service token instead (instead of the invalid token
569
-    # 999888777666).
570
-    if [ ! -e $NOVA_DIR/bin/nova-api-paste.ini ]; then
571
-        cp $FILES/nova-api-paste.ini $NOVA_DIR/bin
572
-        sed -e "s,999888777666,$SERVICE_TOKEN,g" -i $NOVA_DIR/bin/nova-api-paste.ini
573
-    fi
565
+    # We are going to use a sample http middleware configuration based on the
566
+    # one from the keystone project to launch nova.  This paste config adds
567
+    # the configuration required for nova to validate keystone tokens. We add
568
+    # our own service token to the configuration.
569
+    cp $FILES/nova-api-paste.ini $NOVA_DIR/bin
570
+    sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" -i $NOVA_DIR/bin/nova-api-paste.ini
574 571
 fi
575 572
 
576 573
 if [[ "$ENABLED_SERVICES" =~ "n-cpu" ]]; then