Browse Source

etcdcdtl: use new lease interface

Anthony Romano 8 years ago
parent
commit
70f0bbe38c
1 changed files with 5 additions and 6 deletions
  1. 5 6
      etcdctl/ctlv3/command/lease_command.go

+ 5 - 6
etcdctl/ctlv3/command/lease_command.go

@@ -148,13 +148,12 @@ func leaseKeepAliveCommandFunc(cmd *cobra.Command, args []string) {
 	}
 
 	id := leaseFromArgs(args[0])
-	respc, kerr := mustClientFromCmd(cmd).KeepAlive(context.TODO(), id)
-	if kerr != nil {
-		ExitWithError(ExitBadConnection, kerr)
-	}
-
+	respc := mustClientFromCmd(cmd).KeepAlive(context.TODO(), id)
 	for resp := range respc {
-		display.KeepAlive(*resp)
+		if resp.Err != nil {
+			ExitWithError(ExitError, resp.Err)
+		}
+		display.KeepAlive(resp)
 	}
 
 	if _, ok := (display).(*simplePrinter); ok {