mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl: minor cleanup
This commit is contained in:
parent
e3fcc450cf
commit
61befc7ce6
@ -47,7 +47,7 @@ func mkdirCommandFunc(c *cli.Context, ki client.KeysAPI, prevExist client.PrevEx
|
||||
ttl := c.Int("ttl")
|
||||
|
||||
// TODO: handle transport timeout
|
||||
_, err := ki.Set(context.TODO(), key, "", &client.SetOptions{TTL: time.Second * time.Duration(ttl), Dir: true, PrevExist: prevExist})
|
||||
_, err := ki.Set(context.TODO(), key, "", &client.SetOptions{TTL: time.Duration(ttl) * time.Second, Dir: true, PrevExist: prevExist})
|
||||
if err != nil {
|
||||
handleError(ExitServerError, err)
|
||||
}
|
||||
|
@ -18,10 +18,11 @@ import (
|
||||
"errors"
|
||||
|
||||
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/codegangsta/cli"
|
||||
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context" // NewRemoveCommand returns the CLI command for "rm".
|
||||
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
|
||||
"github.com/coreos/etcd/client"
|
||||
)
|
||||
|
||||
// NewRemoveCommand returns the CLI command for "rm".
|
||||
func NewRemoveCommand() cli.Command {
|
||||
return cli.Command{
|
||||
Name: "rm",
|
||||
|
@ -56,7 +56,7 @@ func setCommandFunc(c *cli.Context, ki client.KeysAPI) {
|
||||
prevIndex := c.Int("swap-with-index")
|
||||
|
||||
// TODO: handle transport timeout
|
||||
resp, err := ki.Set(context.TODO(), key, value, &client.SetOptions{TTL: time.Second * time.Duration(ttl), PrevIndex: uint64(prevIndex), PrevValue: prevValue})
|
||||
resp, err := ki.Set(context.TODO(), key, value, &client.SetOptions{TTL: time.Duration(ttl) * time.Second, PrevIndex: uint64(prevIndex), PrevValue: prevValue})
|
||||
if err != nil {
|
||||
handleError(ExitServerError, err)
|
||||
}
|
||||
|
@ -171,9 +171,6 @@ func mustNewClient(c *cli.Context) client.Client {
|
||||
|
||||
if c.GlobalBool("debug") {
|
||||
fmt.Fprintf(os.Stderr, "Cluster-Endpoints: %s\n", strings.Join(hc.Endpoints(), ", "))
|
||||
}
|
||||
|
||||
if c.GlobalBool("debug") {
|
||||
client.EnablecURLDebug()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user