* functions(screen_it): Prior to 58e2134 screen logs were generated
even when run without $SCREEN_DEV. We want to be able to capture
these with devstack-gate for later inspection, so this patch
reintroduces that capability.
Change-Id: Ife127b47d7700878e02285281854595bc6585972
| ... | ... |
@@ -747,17 +747,19 @@ function screen_it {
|
| 747 | 747 |
screen_rc "$1" "$2" |
| 748 | 748 |
|
| 749 | 749 |
screen -S $SCREEN_NAME -X screen -t $1 |
| 750 |
+ |
|
| 751 |
+ if [[ -n ${SCREEN_LOGDIR} ]]; then
|
|
| 752 |
+ screen -S $SCREEN_NAME -p $1 -X logfile ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log
|
|
| 753 |
+ screen -S $SCREEN_NAME -p $1 -X log on |
|
| 754 |
+ ln -sf ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log ${SCREEN_LOGDIR}/screen-${1}.log
|
|
| 755 |
+ fi |
|
| 756 |
+ |
|
| 750 | 757 |
if [[ "$SCREEN_DEV" = "True" ]]; then |
| 751 | 758 |
# sleep to allow bash to be ready to be send the command - we are |
| 752 | 759 |
# creating a new window in screen and then sends characters, so if |
| 753 | 760 |
# bash isn't running by the time we send the command, nothing happens |
| 754 | 761 |
sleep 1.5 |
| 755 | 762 |
|
| 756 |
- if [[ -n ${SCREEN_LOGDIR} ]]; then
|
|
| 757 |
- screen -S $SCREEN_NAME -p $1 -X logfile ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log
|
|
| 758 |
- screen -S $SCREEN_NAME -p $1 -X log on |
|
| 759 |
- ln -sf ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log ${SCREEN_LOGDIR}/screen-${1}.log
|
|
| 760 |
- fi |
|
| 761 | 763 |
NL=`echo -ne '\015'` |
| 762 | 764 |
screen -S $SCREEN_NAME -p $1 -X stuff "$2 || touch \"$SERVICE_DIR/$SCREEN_NAME/$1.failure\"$NL" |
| 763 | 765 |
else |