If you spend a lot of time switching between different cloud, different users, or even different projects for the same user when working with openstack, you’ve come across the problem where one environment variable from an old sourceing pollutes the current environment. I’ve been hit by that enough times that I wrote a small script to clear the environment.
I call it clear_os_env
unset OS_AUTH_TYPE unset OS_AUTH_URL unset OS_CACERT unset OS_COMPUTE_API_VERSION unset OS_DEFAULT_DOMAIN unset OS_DOMAIN_ID unset OS_DOMAIN_NAME unset OS_IDENTITY_API_VERSION unset OS_IDENTITY_PROVIDER unset OS_IDENTITY_PROVIDER_URL unset OS_IMAGE_API_VERSION unset OS_NETWORK_API_VERSION unset OS_OBJECT_API_VERSION unset OS_PASSWORD unset OS_PROJECT_DOMAIN_ID unset OS_PROJECT_DOMAIN_NAME unset OS_PROJECT_ID unset OS_PROJECT_NAME unset OS_REGION_NAME unset OS_SERVICE_ENDPOINT unset OS_SERVICE_PROVIDER_ENDPOINT unset OS_SERVICE_TOKEN unset OS_TENANT_ID unset OS_TENANT_NAME unset OS_TOKEN unset OS_TRUST_ID unset OS_URL unset OS_USERNAME unset OS_USER_DOMAIN_ID unset OS_USER_DOMAIN_NAME unset OS_USER_ID unset OS_USER_ID unset OS_VOLUME_API_VERSION
Source this prior to sourcing any keystone.rc file, and you should have cleared out the old variables, regardless of how vigilant the new source file writer was in clearing old variables. THis includes some old variables that should no longer be used, like OS_SERVICE_TOKEN