Skip to content

Instantly share code, notes, and snippets.

@timrchavez
Last active October 13, 2015 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timrchavez/191fa451516d5e5d4ce0 to your computer and use it in GitHub Desktop.
Save timrchavez/191fa451516d5e5d4ce0 to your computer and use it in GitHub Desktop.
Switch Openstack clouds in your shell using os-client-config config -- I almost feel bad about this one ;-) To use: $(switch-cloud foo)
alias switch-cloud='python -c "from __future__ import print_function;import os_client_config as c, sys; [print(\"export OS_%s=%s\" % (a.upper(), b)) for (a,b) in c.OpenStackConfig().get_one_cloud(sys.argv[1]).auth.iteritems()]"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment