aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-03-18 22:56:44 +0000
committerGerrit Code Review <review@openstack.org>2015-03-18 22:56:44 +0000
commitf2a38c55bd8672c57402efdcf4d59ff428fe780f (patch)
tree33ba404df97d7af76071ca4510ee6df4698eb081 /docs
parent16076af97a383368dc45a2c7df1cbc5ed603e19c (diff)
parent4075c851edc3339adee8ef02bcc291e21b8a738c (diff)
downloadkolla-f2a38c55bd8672c57402efdcf4d59ff428fe780f.tar.gz
kolla-f2a38c55bd8672c57402efdcf4d59ff428fe780f.zip
Merge "The wait_for function needs to be added into all the images"
Diffstat (limited to 'docs')
-rw-r--r--docs/wait-for.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/wait-for.md b/docs/wait-for.md
new file mode 100644
index 000000000..3317c315f
--- /dev/null
+++ b/docs/wait-for.md
@@ -0,0 +1,18 @@
+# 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