Skip to content

Commit

Permalink
fix root path listing
Browse files Browse the repository at this point in the history
  • Loading branch information
lomik committed Oct 26, 2016
1 parent ad4e506 commit 7305e1a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion elock.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,12 @@ func List(options Options, timeout time.Duration) ([]*Record, error) {
return nil, err
}

path := options.Path
if len(path) == 0 || path[len(path)-1] != '/' {
path = path + "/"
}
r, err := etcdClient.Query(
options.Path,
path,
etcd.GET(),
etcd.Recursive(true),
etcd.Timeout(time.Minute),
Expand Down
3 changes: 1 addition & 2 deletions etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"log"
"net/http"
"net/url"
"path"
"strconv"
"sync"
"time"
Expand Down Expand Up @@ -247,7 +246,7 @@ func (client *Client) Query(key string, opts ...Option) (*Response, error) {
QueryLoop:
for {
u, _ := url.Parse(endpoint) // error validated in client contructor
u.Path = path.Join("/v2/keys", key)
u.Path = "/v2/keys" + key

q := &Request{
method: "GET",
Expand Down
2 changes: 1 addition & 1 deletion main/elock.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

const APP = "elock"
const VERSION = "0.3"
const VERSION = "0.3.1"

type Config struct {
EtcdEndpoints []string `json:"etcd-endpoints"`
Expand Down

0 comments on commit 7305e1a

Please sign in to comment.