From 1cb551435365c7e06cb605ff11417f0a43881f37 Mon Sep 17 00:00:00 2001 From: Martin André Date: Thu, 19 Mar 2015 14:42:45 +0900 Subject: Fix `wait_for` function in kolla-common.sh Add `wait_for_output` and `wait_for_output_unless` helper functions that only succeed when the command output contains the expected string, with a possibility to exit early with a failure for `wait_for_output_unless`. Change-Id: Ie20e7c72fb84f626f1a3fe9c4d2f22c9d6863dbe --- docs/wait-for.md | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 docs/wait-for.md (limited to 'docs') diff --git a/docs/wait-for.md b/docs/wait-for.md deleted file mode 100644 index 3317c315f..000000000 --- a/docs/wait-for.md +++ /dev/null @@ -1,18 +0,0 @@ -# Wait-for function - -The usage of the wait_for function looks like the following - $ SCRIPT_NAME LOOPS_NUMBER SLEEP_TIME ARGS - -The ARGS are read and concatenated together into a single command -and the command is executed in a loop until it succeeds or reaches -the max number of attempts (LOOPS_NUMBER). - -An optional FAIL_MATCH_OUTPUT variable may also be set to control -if the loop exits early if the commands stdout/stderr matches the -supplied regex string. -Examples: - $ wait_for 30 10 ping -c 1 192.0.2.2 - $ wait_for 10 1 ls file_we_are_waiting_for - $ wait_for 10 3 date \| grep 8 - $ FAIL_MATCH_OUTPUT=CREATE_FAILED wait_for 30 10 heat stack-show undercloud - $ SUCCESSFUL_MATCH_OUTPUT=CREATE_COMPLETE wait_for 30 10 heat stack-show undercloud -- cgit v1.2.3