Browse code

Merge "Save interactive passwords to separate file"

Jenkins authored on 2015/10/20 00:48:05
Showing 3 changed files
... ...
@@ -134,7 +134,9 @@ rm -rf $DIRS_TO_CLEAN
134 134
 
135 135
 # Clean up files
136 136
 
137
-FILES_TO_CLEAN=".localrc.auto docs/files docs/html shocco/ stack-screenrc test*.conf* test.ini*"
137
+FILES_TO_CLEAN=".localrc.auto .localrc.password "
138
+FILES_TO_CLEAN+="docs/files docs/html shocco/ "
139
+FILES_TO_CLEAN+="stack-screenrc test*.conf* test.ini* "
138 140
 FILES_TO_CLEAN+=".stackenv .prereqs"
139 141
 
140 142
 for file in $FILES_TO_CLEAN; do
... ...
@@ -562,7 +562,7 @@ function read_password {
562 562
     if [[ -f $RC_DIR/localrc ]]; then
563 563
         localrc=$TOP_DIR/localrc
564 564
     else
565
-        localrc=$TOP_DIR/.localrc.auto
565
+        localrc=$TOP_DIR/.localrc.password
566 566
     fi
567 567
 
568 568
     # If the password is not defined yet, proceed to prompt user for a password.
... ...
@@ -572,13 +572,15 @@ function read_password {
572 572
             touch $localrc
573 573
         fi
574 574
 
575
-        # Presumably if we got this far it can only be that our localrc is missing
576
-        # the required password.  Prompt user for a password and write to localrc.
575
+        # Presumably if we got this far it can only be that our
576
+        # localrc is missing the required password.  Prompt user for a
577
+        # password and write to localrc.
578
+
577 579
         echo ''
578 580
         echo '################################################################################'
579 581
         echo $msg
580 582
         echo '################################################################################'
581
-        echo "This value will be written to your localrc file so you don't have to enter it "
583
+        echo "This value will be written to ${localrc} file so you don't have to enter it "
582 584
         echo "again.  Use only alphanumeric characters."
583 585
         echo "If you leave this blank, a random default value will be used."
584 586
         pw=" "
... ...
@@ -103,6 +103,11 @@ HORIZON_APACHE_ROOT="/dashboard"
103 103
 # be disabled for automated testing by setting this value to False.
104 104
 USE_SCREEN=True
105 105
 
106
+# Passwords generated by interactive devstack runs
107
+if [[ -r $RC_DIR/.localrc.password ]]; then
108
+    source $RC_DIR/.localrc.password
109
+fi
110
+
106 111
 # allow local overrides of env variables, including repo config
107 112
 if [[ -f $RC_DIR/localrc ]]; then
108 113
     # Old-style user-supplied config