Write clouds.yaml to /etc as well

There are more than one user that need to access clouds.yaml values
in tests. Rather than copying the file everywhere, simply output
it to /etc/openstack.

However, we have things copying it at the moment, so output to
both places. A follow up patch will remove the homedir version.

Change-Id: I21d3c2ad7a020a5ab02dc1ab532feae70b718892
This commit is contained in:
Monty Taylor 2015-10-19 15:13:30 -04:00 committed by Ian Wienand
parent 80fcf354ed
commit 8f385dde22

@ -76,9 +76,11 @@ 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
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=''
if [ -f "$SSL_BUNDLE_FILE" ]; then
@ -104,6 +106,7 @@ function write_clouds_yaml {
--os-username admin \
--os-password $ADMIN_PASSWORD \
--os-project-name admin
done
}
# trueorfalse <True|False> <VAR>