nova/tools/hooks/post_test_hook.sh
Dan Smith 85bf71b2ae 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
2016-09-29 15:38:18 -07:00

22 lines
539 B
Bash
Executable File

#!/bin/bash -x
MANAGE="/usr/local/bin/nova-manage"
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
$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
}
archive_deleted_rows