Skip to content

Commit 975f420

Browse files
committed
Save interactive passwords to separate file
The interactive password prompt currently saves to .localrc.auto However, this is removed when you re-run stack; that is required as it is how we source the localrc bits of local.conf, and we want the users' changes to be picked up. The passwords, however, should remain constant, because everything has already been setup with them. So write them to a separate file. Note we source before localrc so it can still overwrite them. Some minor flow-changes too Change-Id: I9871c8b8c7569626faf552628de69b811ba4dac0 Closes-Bug: #1505872
1 parent 188b38f commit 975f420

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

clean.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ rm -rf $DIRS_TO_CLEAN
134134

135135
# Clean up files
136136

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* "
138140
FILES_TO_CLEAN+=".stackenv .prereqs"
139141

140142
for file in $FILES_TO_CLEAN; do

stack.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ function read_password {
569569
if [[ -f $RC_DIR/localrc ]]; then
570570
localrc=$TOP_DIR/localrc
571571
else
572-
localrc=$TOP_DIR/.localrc.auto
572+
localrc=$TOP_DIR/.localrc.password
573573
fi
574574

575575
# If the password is not defined yet, proceed to prompt user for a password.
@@ -579,13 +579,15 @@ function read_password {
579579
touch $localrc
580580
fi
581581

582-
# Presumably if we got this far it can only be that our localrc is missing
583-
# the required password. Prompt user for a password and write to localrc.
582+
# Presumably if we got this far it can only be that our
583+
# localrc is missing the required password. Prompt user for a
584+
# password and write to localrc.
585+
584586
echo ''
585587
echo '################################################################################'
586588
echo $msg
587589
echo '################################################################################'
588-
echo "This value will be written to your localrc file so you don't have to enter it "
590+
echo "This value will be written to ${localrc} file so you don't have to enter it "
589591
echo "again. Use only alphanumeric characters."
590592
echo "If you leave this blank, a random default value will be used."
591593
pw=" "

stackrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ HORIZON_APACHE_ROOT="/dashboard"
103103
# be disabled for automated testing by setting this value to False.
104104
USE_SCREEN=True
105105

106+
# Passwords generated by interactive devstack runs
107+
if [[ -r $RC_DIR/.localrc.password ]]; then
108+
source $RC_DIR/.localrc.password
109+
fi
110+
106111
# allow local overrides of env variables, including repo config
107112
if [[ -f $RC_DIR/localrc ]]; then
108113
# Old-style user-supplied config

0 commit comments

Comments
 (0)