Skip to content

Commit

Permalink
Fix bug in etcd backend when connecting to etcd2
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Hook committed May 12, 2015
1 parent 66add71 commit ac0394e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@ type EtcdAdapter struct {
}

func (r *EtcdAdapter) Ping() error {
rr := etcd.NewRawRequest("GET", "version", nil, nil)
_, err := r.client.SendRequest(rr)
var err error
if r.client != nil {
rr := etcd.NewRawRequest("GET", "version", nil, nil)
_, err = r.client.SendRequest(rr)
} else {
rr := etcd2.NewRawRequest("GET", "version", nil, nil)
_, err = r.client2.SendRequest(rr)
}

if err != nil {
return err
}
Expand Down

0 comments on commit ac0394e

Please sign in to comment.