zookeeper: use existing ZOOCFGDIR if present (#6836)
This commit is contained in:
parent
3761a0a608
commit
963de37ee2
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue