From dd02ec6554db7985095354feb308996d4bb9b22d Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Wed, 6 Jan 2016 16:34:39 -0800 Subject: [PATCH] etcdctl: ignore value in updatedir command Fixes coreos#4145. client.KeysAPI ignores value if SetOptions.Dir is true. --- etcdctl/command/update_dir_command.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/etcdctl/command/update_dir_command.go b/etcdctl/command/update_dir_command.go index 8e97a83cb..ac6912a10 100644 --- a/etcdctl/command/update_dir_command.go +++ b/etcdctl/command/update_dir_command.go @@ -16,7 +16,6 @@ package command import ( "errors" - "os" "time" "github.com/coreos/etcd/Godeps/_workspace/src/github.com/codegangsta/cli" @@ -44,15 +43,9 @@ func updatedirCommandFunc(c *cli.Context, ki client.KeysAPI) { handleError(ExitBadArgs, errors.New("key required")) } key := c.Args()[0] - value, err := argOrStdin(c.Args(), os.Stdin, 1) - if err != nil { - handleError(ExitBadArgs, errors.New("value required")) - } - ttl := c.Int("ttl") - ctx, cancel := contextWithTotalTimeout(c) - _, err = ki.Set(ctx, key, value, &client.SetOptions{TTL: time.Duration(ttl) * time.Second, Dir: true, PrevExist: client.PrevExist}) + _, err := ki.Set(ctx, key, "", &client.SetOptions{TTL: time.Duration(ttl) * time.Second, Dir: true, PrevExist: client.PrevExist}) cancel() if err != nil { handleError(ExitServerError, err)