Browse code

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

Russell Bryant authored on 2012/03/29 04:23:58
Showing 1 changed files
... ...
@@ -3,18 +3,18 @@
3 3
 # source openrc [username] [tenantname]
4 4
 #
5 5
 # Configure a set of credentials for $TENANT/$USERNAME:
6
-#   Set TENANT to override the default tenant 'demo'
7
-#   Set USERNAME to override the default user name 'demo'
6
+#   Set OS_TENANT_NAME to override the default tenant 'demo'
7
+#   Set OS_USERNAME to override the default user name 'demo'
8 8
 #   Set ADMIN_PASSWORD to set the password for 'admin' and 'demo'
9 9
 
10 10
 # NOTE: support for the old NOVA_* novaclient environment variables has
11 11
 # been removed.
12 12
 
13 13
 if [[ -n "$1" ]]; then
14
-    USERNAME=$1
14
+    OS_USERNAME=$1
15 15
 fi
16 16
 if [[ -n "$2" ]]; then
17
-    TENANT=$2
17
+    OS_TENANT_NAME=$2
18 18
 fi
19 19
 
20 20
 # Find the other rc files
... ...
@@ -27,11 +27,11 @@ source $RC_DIR/stackrc
27 27
 # term **tenant** as the entity that owns resources.  In some places references
28 28
 # still exist to the original Nova term **project** for this use.  Also,
29 29
 # **tenant_name** is prefered to **tenant_id**.
30
-export OS_TENANT_NAME=${TENANT:-demo}
30
+export OS_TENANT_NAME=${OS_TENANT_NAME:-demo}
31 31
 
32 32
 # In addition to the owning entity (tenant), nova stores the entity performing
33 33
 # the action as the **user**.
34
-export OS_USERNAME=${USERNAME:-demo}
34
+export OS_USERNAME=${OS_USERNAME:-demo}
35 35
 
36 36
 # With Keystone you pass the keystone password instead of an api key.
37 37
 # Recent versions of novaclient use OS_PASSWORD instead of NOVA_API_KEYs