summaryrefslogtreecommitdiff
path: root/tools/hooks/post_test_hook.sh
diff options
context:
space:
mode:
authorDan Smith <dansmith@redhat.com>2016-09-28 07:54:56 -0700
committerDan Smith <dansmith@redhat.com>2016-09-29 15:38:18 -0700
commit85bf71b2aedfa50af4aa9135c8099602e555bc74 (patch)
treefa72f503fd4186aabf4350180596c04027c1645e /tools/hooks/post_test_hook.sh
parentd5f113de34589933c23a7cecc25ca0bf5f47207d (diff)
downloadnova-85bf71b2aedfa50af4aa9135c8099602e555bc74.tar.gz
Make db archival return a meaningful result code
This helps with automating to know when it's done. Update our own post-test-hook to use it. Change-Id: I61c3b187edab3e0e612470735eecd2db59028413
Diffstat (limited to 'tools/hooks/post_test_hook.sh')
-rwxr-xr-xtools/hooks/post_test_hook.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/hooks/post_test_hook.sh b/tools/hooks/post_test_hook.sh
index 72237a1e26..5f72eb378d 100755
--- a/tools/hooks/post_test_hook.sh
+++ b/tools/hooks/post_test_hook.sh
@@ -6,9 +6,13 @@ function archive_deleted_rows {
# NOTE(danms): Run this a few times to make sure that we end
# up with nothing more to archive
for i in `seq 30`; do
- out=$($MANAGE db archive_deleted_rows --verbose --max_rows 1000)
- echo $?
- if [[ $out =~ "Nothing was archived" ]]; then
+ $MANAGE db archive_deleted_rows --verbose --max_rows 1000
+ RET=$?
+ if [[ $RET -gt 1 ]]; then
+ echo Archiving failed with result $RET
+ return $RET
+ elif [[ $RET -eq 0 ]]; then
+ echo Archiving Complete
break;
fi
done