zookeeper: use existing ZOOCFGDIR if present (#6836)

This commit is contained in:
Dan Dillinger 2016-11-17 08:23:42 -08:00 committed by Mike McQuaid
parent 3761a0a608
commit 963de37ee2

View file

@ -38,7 +38,7 @@ class Zookeeper < Formula
def default_zk_env
<<-EOS.undent
export ZOOCFGDIR="#{etc}/zookeeper"
[ -z "$ZOOCFGDIR" ] && export ZOOCFGDIR="#{etc}/zookeeper"
EOS
end
@ -154,4 +154,11 @@ class Zookeeper < Formula
</plist>
EOS
end
test do
output = shell_output("#{bin}/zkServer -h 2>&1")
assert_match "Using config: #{etc}/zookeeper/zoo.cfg", output
output = shell_output("ZOOCFGDIR=/tmp #{bin}/zkServer -h 2>&1")
assert_match "Using config: /tmp/zoo.cfg", output
end
end