Skip to content

Commit

Permalink
fix tiny
Browse files Browse the repository at this point in the history
  • Loading branch information
shuijing198799 committed Mar 31, 2020
1 parent 3a44cb1 commit 93401c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/backup-manager/app/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ func (bo *Options) backupData(backup *v1alpha1.Backup) (string, error) {
fullArgs = append(fullArgs, args...)
klog.Infof("Running br command with args: %v", fullArgs)
cmd := exec.Command("br", fullArgs...)
cmd.Stderr = cmd.Stdout
stdOut, err := cmd.StdoutPipe()
if err != nil {
return remotePath, fmt.Errorf("cluster %s, create stdout pipe failed, err: %v", bo, err)
}
err = cmd.Start()
if err != nil {
return remotePath, fmt.Errorf("cluster %s, execute br command %v failed, output: %s, err: %v", bo, fullArgs, err)
return remotePath, fmt.Errorf("cluster %s, execute br command failed, output: %s, err: %v", bo, fullArgs, err)
}
var tmpOutput, errMsg string
for {
Expand Down
3 changes: 2 additions & 1 deletion cmd/backup-manager/app/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ func (ro *Options) restoreData(restore *v1alpha1.Restore) error {
fullArgs = append(fullArgs, args...)
klog.Infof("Running br command with args: %v", fullArgs)
cmd := exec.Command("br", fullArgs...)
cmd.Stderr = cmd.Stdout
stdOut, err := cmd.StdoutPipe()
if err != nil {
return fmt.Errorf("cluster %s, create stdout pipe failed, err: %v", ro, err)
}
err = cmd.Start()
if err != nil {
return fmt.Errorf("cluster %s, execute br command %v failed, output: %s, err: %v", ro, fullArgs, err)
return fmt.Errorf("cluster %s, execute br command failed, output: %s, err: %v", ro, fullArgs, err)
}
var tmpOutput, errMsg string
for {
Expand Down

0 comments on commit 93401c5

Please sign in to comment.