Don't use $USERNAME in openrc.

Fix bug 967429.

Don't use $USERNAME as a variable in openrc.  It's commonly set by
default and can result in $OS_USERNAME getting set to something else
unexpectedly, resulting in an environment that doesn't work.

Change-Id: I6083a871209d30c81ca6876b1ef6c154aef7f598
This commit is contained in:
Russell Bryant 2012-03-28 15:23:58 -04:00
parent 408b009ccd
commit 08e07fb4c8

12
openrc
View File

@ -3,18 +3,18 @@
# source openrc [username] [tenantname] # source openrc [username] [tenantname]
# #
# Configure a set of credentials for $TENANT/$USERNAME: # Configure a set of credentials for $TENANT/$USERNAME:
# Set TENANT to override the default tenant 'demo' # Set OS_TENANT_NAME to override the default tenant 'demo'
# Set USERNAME to override the default user name 'demo' # Set OS_USERNAME to override the default user name 'demo'
# Set ADMIN_PASSWORD to set the password for 'admin' and 'demo' # Set ADMIN_PASSWORD to set the password for 'admin' and 'demo'
# NOTE: support for the old NOVA_* novaclient environment variables has # NOTE: support for the old NOVA_* novaclient environment variables has
# been removed. # been removed.
if [[ -n "$1" ]]; then if [[ -n "$1" ]]; then
USERNAME=$1 OS_USERNAME=$1
fi fi
if [[ -n "$2" ]]; then if [[ -n "$2" ]]; then
TENANT=$2 OS_TENANT_NAME=$2
fi fi
# Find the other rc files # Find the other rc files
@ -27,11 +27,11 @@ source $RC_DIR/stackrc
# term **tenant** as the entity that owns resources. In some places references # term **tenant** as the entity that owns resources. In some places references
# still exist to the original Nova term **project** for this use. Also, # still exist to the original Nova term **project** for this use. Also,
# **tenant_name** is prefered to **tenant_id**. # **tenant_name** is prefered to **tenant_id**.
export OS_TENANT_NAME=${TENANT:-demo} export OS_TENANT_NAME=${OS_TENANT_NAME:-demo}
# In addition to the owning entity (tenant), nova stores the entity performing # In addition to the owning entity (tenant), nova stores the entity performing
# the action as the **user**. # the action as the **user**.
export OS_USERNAME=${USERNAME:-demo} export OS_USERNAME=${OS_USERNAME:-demo}
# With Keystone you pass the keystone password instead of an api key. # With Keystone you pass the keystone password instead of an api key.
# Recent versions of novaclient use OS_PASSWORD instead of NOVA_API_KEYs # Recent versions of novaclient use OS_PASSWORD instead of NOVA_API_KEYs