From 8f385dde22815de5e7487e52cf78374f5c2967b3 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 19 Oct 2015 15:13:30 -0400 Subject: [PATCH] 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 --- functions-common | 55 +++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/functions-common b/functions-common index f95bfe543f..42555a95f5 100644 --- a/functions-common +++ b/functions-common @@ -76,34 +76,37 @@ 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 - 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 3 \ - $CA_CERT_ARG \ - --os-auth-url $KEYSTONE_AUTH_URI \ - --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 3 \ - $CA_CERT_ARG \ - --os-auth-url $KEYSTONE_AUTH_URI \ - --os-username admin \ - --os-password $ADMIN_PASSWORD \ - --os-project-name admin + 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 3 \ + $CA_CERT_ARG \ + --os-auth-url $KEYSTONE_AUTH_URI \ + --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 3 \ + $CA_CERT_ARG \ + --os-auth-url $KEYSTONE_AUTH_URI \ + --os-username admin \ + --os-password $ADMIN_PASSWORD \ + --os-project-name admin + done } # trueorfalse