Fix podman save when redirecting output

podman save would write the progress bar to the image tar file
when the output was redirected with >.
Fixed the writer to write to stderr for all commands using writer

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #362
Approved by: mheon
This commit is contained in:
umohnani8
2018-02-19 15:39:56 -05:00
committed by Atomic Bot
parent 8eb5cf7489
commit 8f8fd1d900
5 changed files with 6 additions and 5 deletions

View File

@ -392,7 +392,7 @@ func imageData(c *cli.Context, runtime *libpod.Runtime, image string) (string, s
// Pull the image // Pull the image
var writer io.Writer var writer io.Writer
if !c.Bool("quiet") { if !c.Bool("quiet") {
writer = os.Stdout writer = os.Stderr
} }
createImage.Pull(writer) createImage.Pull(writer)
} }

View File

@ -93,7 +93,7 @@ func loadCmd(c *cli.Context) error {
var writer io.Writer var writer io.Writer
if !c.Bool("quiet") { if !c.Bool("quiet") {
writer = os.Stdout writer = os.Stderr
} }
options := libpod.CopyOptions{ options := libpod.CopyOptions{

View File

@ -5,6 +5,7 @@ import (
"os" "os"
"fmt" "fmt"
"github.com/containers/image/types" "github.com/containers/image/types"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/projectatomic/libpod/libpod" "github.com/projectatomic/libpod/libpod"
@ -90,7 +91,7 @@ func pullCmd(c *cli.Context) error {
var writer io.Writer var writer io.Writer
if !c.Bool("quiet") { if !c.Bool("quiet") {
writer = os.Stdout writer = os.Stderr
} }
options := libpod.CopyOptions{ options := libpod.CopyOptions{

View File

@ -118,7 +118,7 @@ func pushCmd(c *cli.Context) error {
var writer io.Writer var writer io.Writer
if !c.Bool("quiet") { if !c.Bool("quiet") {
writer = os.Stdout writer = os.Stderr
} }
var manifestType string var manifestType string

View File

@ -75,7 +75,7 @@ func saveCmd(c *cli.Context) error {
var writer io.Writer var writer io.Writer
if !c.Bool("quiet") { if !c.Bool("quiet") {
writer = os.Stdout writer = os.Stderr
} }
output := c.String("output") output := c.String("output")