openstacksdk/create_yaml.sh
Terry Howe f5e77c6be9 Fix the network quota tests
These network quota tests were badly broken.  I simplified them
up a lot so they will require less maintenance.

Change-Id: I9738b9283de2e731510f6ed5ff208c075ea48940
Partial-bug: #1665495
2017-02-19 09:46:52 -07:00

32 lines
724 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
export OS_IDENTITY_API_VERSION=3 # force v3 identity
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