Merge "Write clouds.yaml to /etc as well"

This commit is contained in:
Jenkins 2015-10-20 04:02:04 +00:00 committed by Gerrit Code Review
commit b10c6205d2

@ -76,34 +76,37 @@ function write_clouds_yaml {
# The location is a variable to allow for easier refactoring later to make it # 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 # overridable. There is currently no usecase where doing so makes sense, so
# it's not currently configurable. # it's not currently configurable.
CLOUDS_YAML=~/.config/openstack/clouds.yaml for clouds_path in /etc/openstack ~/.config/openstack ; do
CLOUDS_YAML=$clouds_path/clouds.yaml
mkdir -p $(dirname $CLOUDS_YAML) sudo mkdir -p $(dirname $CLOUDS_YAML)
sudo chown -R $STACK_USER $(dirname $CLOUDS_YAML)
CA_CERT_ARG='' CA_CERT_ARG=''
if [ -f "$SSL_BUNDLE_FILE" ]; then if [ -f "$SSL_BUNDLE_FILE" ]; then
CA_CERT_ARG="--os-cacert $SSL_BUNDLE_FILE" CA_CERT_ARG="--os-cacert $SSL_BUNDLE_FILE"
fi fi
$TOP_DIR/tools/update_clouds_yaml.py \ $TOP_DIR/tools/update_clouds_yaml.py \
--file $CLOUDS_YAML \ --file $CLOUDS_YAML \
--os-cloud devstack \ --os-cloud devstack \
--os-region-name $REGION_NAME \ --os-region-name $REGION_NAME \
--os-identity-api-version 3 \ --os-identity-api-version 3 \
$CA_CERT_ARG \ $CA_CERT_ARG \
--os-auth-url $KEYSTONE_AUTH_URI \ --os-auth-url $KEYSTONE_AUTH_URI \
--os-username demo \ --os-username demo \
--os-password $ADMIN_PASSWORD \ --os-password $ADMIN_PASSWORD \
--os-project-name demo --os-project-name demo
$TOP_DIR/tools/update_clouds_yaml.py \ $TOP_DIR/tools/update_clouds_yaml.py \
--file $CLOUDS_YAML \ --file $CLOUDS_YAML \
--os-cloud devstack-admin \ --os-cloud devstack-admin \
--os-region-name $REGION_NAME \ --os-region-name $REGION_NAME \
--os-identity-api-version 3 \ --os-identity-api-version 3 \
$CA_CERT_ARG \ $CA_CERT_ARG \
--os-auth-url $KEYSTONE_AUTH_URI \ --os-auth-url $KEYSTONE_AUTH_URI \
--os-username admin \ --os-username admin \
--os-password $ADMIN_PASSWORD \ --os-password $ADMIN_PASSWORD \
--os-project-name admin --os-project-name admin
done
} }
# trueorfalse <True|False> <VAR> # trueorfalse <True|False> <VAR>