Browse code

Fix account rc files creation for Swift users

Id02ebdfa5cb3f6c763293876c6bb031184ebd663 introduced a small
regression which makes the command x509-create-cert fail with
'ERROR (CommandError): Invalid OpenStack Nova credentials.' for
Swift users.

The handling of specific password for Swift users was introduced
in Ifb57a43aad439ffe041e98465719a8a8eceae544

Change-Id: I3f328b1358bad0bdf7056796eabfe846dd5bae3a

JordanP authored on 2014/10/07 06:08:50
Showing 2 changed files
... ...
@@ -557,9 +557,11 @@ function create_swift_disk {
557 557
 
558 558
 function create_swift_accounts {
559 559
     # Defines specific passwords used by tools/create_userrc.sh
560
-    local swiftusertest1_password=testing
561
-    local swiftusertest2_password=testing2
562
-    local swiftusertest3_password=testing3
560
+    # As these variables are used by create_userrc.sh, they must be exported
561
+    # The _password suffix is expected by create_userrc.sh
562
+    export swiftusertest1_password=testing
563
+    export swiftusertest2_password=testing2
564
+    export swiftusertest3_password=testing3
563 565
 
564 566
     KEYSTONE_CATALOG_BACKEND=${KEYSTONE_CATALOG_BACKEND:-sql}
565 567
 
... ...
@@ -254,7 +254,8 @@ if [ $MODE != "create" ]; then
254 254
 
255 255
             # Checks for a specific password defined for an user.
256 256
             # Example for an username johndoe: JOHNDOE_PASSWORD=1234
257
-            eval SPECIFIC_UPASSWORD="\$${USER_NAME^^}_PASSWORD"
257
+            # This mechanism is used by lib/swift
258
+            eval SPECIFIC_UPASSWORD="\$${user_name}_password"
258 259
             if [ -n "$SPECIFIC_UPASSWORD" ]; then
259 260
                 USER_PASS=$SPECIFIC_UPASSWORD
260 261
             fi