Unified SDK for OpenStack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

create_yaml.sh 724B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. #
  3. # NOTE(thowe): There are some issues with OCC envvars that force us to do
  4. # this for now.
  5. #
  6. mkdir -p ~/.config/openstack/
  7. FILE=~/.config/openstack/clouds.yaml
  8. export OS_IDENTITY_API_VERSION=3 # force v3 identity
  9. echo 'clouds:' >$FILE
  10. echo ' test_cloud:' >>$FILE
  11. env | grep OS_ | tr '=' ' ' | while read k v
  12. do
  13. k=$(echo $k | sed -e 's/OS_//')
  14. k=$(echo $k | tr '[A-Z]' '[a-z]')
  15. case "$k" in
  16. region_name|*_api_version)
  17. echo " $k: $v" >>$FILE
  18. esac
  19. done
  20. echo " auth:" >>$FILE
  21. env | grep OS_ | tr '=' ' ' | while read k v
  22. do
  23. k=$(echo $k | sed -e 's/OS_//')
  24. k=$(echo $k | tr '[A-Z]' '[a-z]')
  25. case "$k" in
  26. region_name|*_api_version)
  27. ;;
  28. *)
  29. echo " $k: $v" >>$FILE
  30. esac
  31. done