Merge "Write selected env variables to .stackenv"
This commit is contained in:
commit
82cefc2570
5
openrc
5
openrc
@ -26,6 +26,11 @@ source $RC_DIR/functions
|
|||||||
# Load local configuration
|
# Load local configuration
|
||||||
source $RC_DIR/stackrc
|
source $RC_DIR/stackrc
|
||||||
|
|
||||||
|
# Load the last env variables if available
|
||||||
|
if [[ -r $TOP_DIR/.stackenv ]]; then
|
||||||
|
source $TOP_DIR/.stackenv
|
||||||
|
fi
|
||||||
|
|
||||||
# Get some necessary configuration
|
# Get some necessary configuration
|
||||||
source $RC_DIR/lib/tls
|
source $RC_DIR/lib/tls
|
||||||
|
|
||||||
|
15
stack.sh
15
stack.sh
@ -90,6 +90,11 @@ DEST=${DEST:-/opt/stack}
|
|||||||
# Sanity Check
|
# Sanity Check
|
||||||
# ============
|
# ============
|
||||||
|
|
||||||
|
# Clean up last environment var cache
|
||||||
|
if [[ -r $TOP_DIR/.stackenv ]]; then
|
||||||
|
rm $TOP_DIR/.stackenv
|
||||||
|
fi
|
||||||
|
|
||||||
# Import database configuration
|
# Import database configuration
|
||||||
source $TOP_DIR/lib/database
|
source $TOP_DIR/lib/database
|
||||||
|
|
||||||
@ -537,9 +542,9 @@ function echo_nolog() {
|
|||||||
# Set ``LOGFILE`` to turn on logging
|
# Set ``LOGFILE`` to turn on logging
|
||||||
# Append '.xxxxxxxx' to the given name to maintain history
|
# Append '.xxxxxxxx' to the given name to maintain history
|
||||||
# where 'xxxxxxxx' is a representation of the date the file was created
|
# where 'xxxxxxxx' is a representation of the date the file was created
|
||||||
|
TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"}
|
||||||
if [[ -n "$LOGFILE" || -n "$SCREEN_LOGDIR" ]]; then
|
if [[ -n "$LOGFILE" || -n "$SCREEN_LOGDIR" ]]; then
|
||||||
LOGDAYS=${LOGDAYS:-7}
|
LOGDAYS=${LOGDAYS:-7}
|
||||||
TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"}
|
|
||||||
CURRENT_LOG_TIME=$(date "+$TIMESTAMP_FORMAT")
|
CURRENT_LOG_TIME=$(date "+$TIMESTAMP_FORMAT")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -1706,6 +1711,14 @@ if is_service_enabled tempest; then
|
|||||||
echo '**************************************************'
|
echo '**************************************************'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Save some values we generated for later use
|
||||||
|
CURRENT_RUN_TIME=$(date "+$TIMESTAMP_FORMAT")
|
||||||
|
echo "# $CURRENT_RUN_TIME" >$TOP_DIR/.stackenv
|
||||||
|
for i in BASE_SQL_CONN ENABLED_SERVICES HOST_IP LOGFILE \
|
||||||
|
SERVICE_HOST SERVICE_PROTOCOL TLS_IP; do
|
||||||
|
echo $i=${!i} >>$TOP_DIR/.stackenv
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# Run local script
|
# Run local script
|
||||||
# ================
|
# ================
|
||||||
|
Loading…
Reference in New Issue
Block a user