taskflow/tools/clear_zk.sh
Joshua Harlow 131eb0c3b3 Replace clear zookeeper python with clear zookeeper bash
The zk-shell binary/library can save us from having to do
alot here so just use it and remove some code.

Change-Id: I07bde4dea61a125f7368349517e9878c2ee25608
2016-01-14 21:47:17 -08:00

16 lines
371 B
Bash
Executable File

#!/bin/bash
# This requires https://pypi.python.org/pypi/zk_shell/ to be installed...
set -e
ZK_HOSTS=${ZK_HOSTS:-localhost:2181}
TF_PATH=${TF_PATH:-taskflow}
for path in `zk-shell --run-once "ls" $ZK_HOSTS`; do
if [[ $path == ${TF_PATH}* ]]; then
echo "Removing (recursively) path \"$path\""
zk-shell --run-once "rmr $path" $ZK_HOSTS
fi
done