openstacksdk/create_yaml.sh
Terry Howe c0358d0bd5 Create clouds.yaml for functional tests
Change-Id: I5d6d0c587b65e0ca877a4d13c89c4cd6ac90ef50
2015-05-30 12:30:36 -06:00

31 lines
671 B
Bash
Executable File

#!/bin/bash
#
# NOTE(thowe): There are some issues with OCC envvars that force us to do
# this for now.
#
mkdir -p ~/.config/openstack/
FILE=~/.config/openstack/clouds.yaml
echo 'clouds:' >$FILE
echo ' test_cloud:' >>$FILE
env | grep OS_ | tr '=' ' ' | while read k v
do
k=$(echo $k | sed -e 's/OS_//')
k=$(echo $k | tr '[A-Z]' '[a-z]')
case "$k" in
region_name|*_api_version)
echo " $k: $v" >>$FILE
esac
done
echo " auth:" >>$FILE
env | grep OS_ | tr '=' ' ' | while read k v
do
k=$(echo $k | sed -e 's/OS_//')
k=$(echo $k | tr '[A-Z]' '[a-z]')
case "$k" in
region_name|*_api_version)
;;
*)
echo " $k: $v" >>$FILE
esac
done