If stack.sh fails before os-testr is installed, the generate-subunit
command won't exist.
Change-Id: I7998ed81e419e25d183e5a780df0b4459cca237c
| ... | ... |
@@ -537,14 +537,20 @@ function exit_trap {
|
| 537 | 537 |
|
| 538 | 538 |
if [[ $r -ne 0 ]]; then |
| 539 | 539 |
echo "Error on exit" |
| 540 |
- generate-subunit $DEVSTACK_START_TIME $SECONDS 'fail' >> ${SUBUNIT_OUTPUT}
|
|
| 540 |
+ # If we error before we've installed os-testr, which will fail. |
|
| 541 |
+ if type -p generate-subunit > /dev/null; then |
|
| 542 |
+ generate-subunit $DEVSTACK_START_TIME $SECONDS 'fail' >> ${SUBUNIT_OUTPUT}
|
|
| 543 |
+ fi |
|
| 541 | 544 |
if [[ -z $LOGDIR ]]; then |
| 542 | 545 |
$TOP_DIR/tools/worlddump.py |
| 543 | 546 |
else |
| 544 | 547 |
$TOP_DIR/tools/worlddump.py -d $LOGDIR |
| 545 | 548 |
fi |
| 546 | 549 |
else |
| 547 |
- generate-subunit $DEVSTACK_START_TIME $SECONDS >> ${SUBUNIT_OUTPUT}
|
|
| 550 |
+ # If we error before we've installed os-testr, which will fail. |
|
| 551 |
+ if type -p generate-subunit > /dev/null; then |
|
| 552 |
+ generate-subunit $DEVSTACK_START_TIME $SECONDS >> ${SUBUNIT_OUTPUT}
|
|
| 553 |
+ fi |
|
| 548 | 554 |
fi |
| 549 | 555 |
|
| 550 | 556 |
exit $r |