Skip to content

Commit

Permalink
Merge pull request #658 from gebailey/master
Browse files Browse the repository at this point in the history
Don't pass empty prefix to zookeeper nodeWalk
  • Loading branch information
okushchenko authored Jan 26, 2018
2 parents 5d6e279 + ac1b936 commit 0c4cb29
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backends/zookeeper/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func NewZookeeperClient(machines []string) (*Client, error) {
}

func nodeWalk(prefix string, c *Client, vars map[string]string) error {
var s string
l, stat, err := c.client.Children(prefix)
if err != nil {
return err
Expand All @@ -37,7 +38,11 @@ func nodeWalk(prefix string, c *Client, vars map[string]string) error {

} else {
for _, key := range l {
s := prefix + "/" + key
if prefix == "/" {
s = "/" + key
} else {
s = prefix + "/" + key
}
_, stat, err := c.client.Exists(s)
if err != nil {
return err
Expand All @@ -64,9 +69,6 @@ func (c *Client) GetValues(keys []string) (map[string]string, error) {
if err != nil {
return vars, err
}
if v == "/" {
v = ""
}
err = nodeWalk(v, c, vars)
if err != nil {
return vars, err
Expand Down

0 comments on commit 0c4cb29

Please sign in to comment.