Browse code

Merge "Use extended keystone-manage bootstrap parameters"

Jenkins authored on 2016/03/15 06:03:08
Showing 1 changed files
... ...
@@ -628,40 +628,16 @@ function stop_keystone {
628 628
 # - ``KEYSTONE_SERVICE_HOST``
629 629
 # - ``KEYSTONE_SERVICE_PORT``
630 630
 function bootstrap_keystone {
631
-
632
-    # Initialize keystone, this will create an 'admin' user, 'admin' project,
633
-    # 'admin' role, and assign the user the role on the project. These resources
634
-    # are created only if they do not already exist.
635
-    $KEYSTONE_BIN_DIR/keystone-manage bootstrap --bootstrap-password $ADMIN_PASSWORD
636
-
637
-    # Create the keystone service and endpoints. To do this with the new
638
-    # bootstrapping process, we need to get a token and use that token to
639
-    # interact with the new APIs. The token will only be used to create services
640
-    # and endpoints, thus creating a minimal service catalog.
641
-    # They are unset immediately after.
642
-    # TODO(stevemar): OpenStackClient and KeystoneClient do not have support to
643
-    # handle interactions that not return service catalogs. Eventually remove
644
-    # this section when the support is in place. Use token based auth for now.
645
-    local token_id
646
-    token_id=$(openstack token issue -c id -f value \
647
-        --os-username admin --os-project-name admin \
648
-        --os-user-domain-id default --os-project-domain-id default \
649
-        --os-identity-api-version 3 --os-auth-url $KEYSTONE_AUTH_URI \
650
-        --os-password $ADMIN_PASSWORD)
651
-
652
-    export OS_TOKEN=$token_id
653
-    export OS_URL=$KEYSTONE_AUTH_URI/v3
654
-    export OS_IDENTITY_API_VERSION=3
655
-
656
-    get_or_create_service "keystone" "identity" "Keystone Identity Service"
657
-    get_or_create_endpoint \
658
-        "identity" \
659
-        "$REGION_NAME" \
660
-        "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$IDENTITY_API_VERSION" \
661
-        "$KEYSTONE_AUTH_URI/v$IDENTITY_API_VERSION" \
662
-        "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$IDENTITY_API_VERSION"
663
-
664
-    unset OS_TOKEN OS_URL OS_IDENTITY_API_VERSION
631
+    $KEYSTONE_BIN_DIR/keystone-manage bootstrap \
632
+        --bootstrap-username admin \
633
+        --bootstrap-password "$ADMIN_PASSWORD" \
634
+        --bootstrap-project-name admin \
635
+        --bootstrap-role-name admin \
636
+        --bootstrap-service-name keystone \
637
+        --bootstrap-region-id "$REGION_NAME" \
638
+        --bootstrap-admin-url "$KEYSTONE_AUTH_URI/v$IDENTITY_API_VERSION" \
639
+        --bootstrap-public-url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$IDENTITY_API_VERSION" \
640
+        --bootstrap-internal-url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$IDENTITY_API_VERSION"
665 641
 }
666 642
 
667 643
 # Restore xtrace