Otherwise, it does not work as supposed to work in statements like below:
set -e
test_status_in_pool_dir ... && ...
(e.g. in wait_for_status_in_pool_dir)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
(cherry picked from commit
7c078eda0fc260f6a885fa43f377b47844867d12)
local status_log=${TEMPDIR}/${cluster}-${image}.mirror_status
rbd --cluster ${cluster} -p ${pool} mirror image status ${image} |
tee ${status_log} >&2
- grep "state: .*${state_pattern}" ${status_log}
- grep "description: .*${description_pattern}" ${status_log}
+ grep "state: .*${state_pattern}" ${status_log} || return 1
+ grep "description: .*${description_pattern}" ${status_log} || return 1
}
wait_for_status_in_pool_dir()