Skip to content
/ etcd Public
forked from etcd-io/etcd

Commit

Permalink
ctlv3: overwrite "snapshot restore" output with os.Stdout
Browse files Browse the repository at this point in the history
Fix etcd-io#9179.

Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed Feb 6, 2018
1 parent 63183f8 commit b7e4548
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions etcdctl/ctlv3/command/snapshot_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ package command
import (
"context"
"fmt"
"os"
"path/filepath"
"strings"

"github.com/coreos/etcd/pkg/logger"
"github.com/coreos/etcd/pkg/types"
"github.com/coreos/etcd/snapshot"

"github.com/coreos/pkg/capnslog"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -90,6 +92,11 @@ func NewSnapshotRestoreCommand() *cobra.Command {
return cmd
}

func init() {
// overwrite output (capnslog defaults to os.Stderr)
capnslog.SetFormatter(capnslog.NewDefaultFormatter(os.Stdout))
}

func snapshotSaveCommandFunc(cmd *cobra.Command, args []string) {
if len(args) != 1 {
err := fmt.Errorf("snapshot save expects one argument")
Expand Down

0 comments on commit b7e4548

Please sign in to comment.