diff --git a/functions-common b/functions-common index 446de5374f..4fca80e14b 100644 --- a/functions-common +++ b/functions-common @@ -67,6 +67,45 @@ function save_stackenv { done } +# Update/create user clouds.yaml file. +# clouds.yaml will have +# - A `devstack` entry for the `demo` user for the `demo` project. +# - A `devstack-admin` entry for the `admin` user for the `admin` project. +# write_clouds_yaml +function write_clouds_yaml { + # The location is a variable to allow for easier refactoring later to make it + # overridable. There is currently no usecase where doing so makes sense, so + # it's not currently configurable. + CLOUDS_YAML=~/.config/openstack/clouds.yaml + + mkdir -p $(dirname $CLOUDS_YAML) + + CA_CERT_ARG='' + if [ -f "$SSL_BUNDLE_FILE" ]; then + CA_CERT_ARG="--os-cacert $SSL_BUNDLE_FILE" + fi + $TOP_DIR/tools/update_clouds_yaml.py \ + --file $CLOUDS_YAML \ + --os-cloud devstack \ + --os-region-name $REGION_NAME \ + --os-identity-api-version $IDENTITY_API_VERSION \ + $CA_CERT_ARG \ + --os-auth-url $KEYSTONE_AUTH_URI/v$IDENTITY_API_VERSION \ + --os-username demo \ + --os-password $ADMIN_PASSWORD \ + --os-project-name demo + $TOP_DIR/tools/update_clouds_yaml.py \ + --file $CLOUDS_YAML \ + --os-cloud devstack-admin \ + --os-region-name $REGION_NAME \ + --os-identity-api-version $IDENTITY_API_VERSION \ + $CA_CERT_ARG \ + --os-auth-url $KEYSTONE_AUTH_URI/v$IDENTITY_API_VERSION \ + --os-username admin \ + --os-password $ADMIN_PASSWORD \ + --os-project-name admin +} + # Normalize config values to True or False # Accepts as False: 0 no No NO false False FALSE # Accepts as True: 1 yes Yes YES true True TRUE diff --git a/stack.sh b/stack.sh index 7184e59bc0..21760213ec 100755 --- a/stack.sh +++ b/stack.sh @@ -1064,42 +1064,8 @@ fi # Save some values we generated for later use save_stackenv -# Update/create user clouds.yaml file. -# clouds.yaml will have -# - A `devstack` entry for the `demo` user for the `demo` project. -# - A `devstack-admin` entry for the `admin` user for the `admin` project. - -# The location is a variable to allow for easier refactoring later to make it -# overridable. There is currently no usecase where doing so makes sense, so -# it's not currently configurable. -CLOUDS_YAML=~/.config/openstack/clouds.yaml - -mkdir -p $(dirname $CLOUDS_YAML) - -CA_CERT_ARG='' -if [ -f "$SSL_BUNDLE_FILE" ]; then - CA_CERT_ARG="--os-cacert $SSL_BUNDLE_FILE" -fi -$TOP_DIR/tools/update_clouds_yaml.py \ - --file $CLOUDS_YAML \ - --os-cloud devstack \ - --os-region-name $REGION_NAME \ - --os-identity-api-version $IDENTITY_API_VERSION \ - $CA_CERT_ARG \ - --os-auth-url $KEYSTONE_AUTH_URI/v$IDENTITY_API_VERSION \ - --os-username demo \ - --os-password $ADMIN_PASSWORD \ - --os-project-name demo -$TOP_DIR/tools/update_clouds_yaml.py \ - --file $CLOUDS_YAML \ - --os-cloud devstack-admin \ - --os-region-name $REGION_NAME \ - --os-identity-api-version $IDENTITY_API_VERSION \ - $CA_CERT_ARG \ - --os-auth-url $KEYSTONE_AUTH_URI/v$IDENTITY_API_VERSION \ - --os-username admin \ - --os-password $ADMIN_PASSWORD \ - --os-project-name admin +# Write a clouds.yaml file +write_clouds_yaml # Horizon # -------