diff --git a/cmd/root.go b/cmd/root.go index c65c786..0029677 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -21,7 +21,7 @@ var ( var rootCmd = &cobra.Command{ Use: "playbookctl", Short: "Ansible Playbook Dedic2 Control", - Version: "4.0.2", + Version: "4.0.3", RunE: func(cmd *cobra.Command, _ []string) error { return cmd.Help() }, diff --git a/internal/space_worker/restore.go b/internal/space_worker/restore.go index eb447ec..6f6fad6 100644 --- a/internal/space_worker/restore.go +++ b/internal/space_worker/restore.go @@ -38,7 +38,10 @@ func (app *SpaceWorker) Restore(targetHost string, timestamp string, inventory s app.log.Info(fmt.Sprintf("Target Host: %s", host)) app.log.Info("Pre restore Ansible") - _ = command.Run() + err = command.Run() + if err != nil { + return err + } app.log.Info("Send files") command = exec.Command("/bin/bash", "-c", preRestoreFile) @@ -59,7 +62,10 @@ func (app *SpaceWorker) Restore(targetHost string, timestamp string, inventory s command.Stdin = os.Stdin command.Stdout = os.Stdout command.Stderr = os.Stderr - _ = command.Run() + err = command.Run() + if err != nil { + return err + } app.log.Info("Clean temp files") command = exec.Command("/bin/bash", "-c", preRestoreFile+"_clean") @@ -67,7 +73,10 @@ func (app *SpaceWorker) Restore(targetHost string, timestamp string, inventory s command.Stdin = os.Stdin command.Stdout = os.Stdout command.Stderr = os.Stderr - _ = command.Run() + err = command.Run() + if err != nil { + return err + } if err = utils.RemoveFile(preRestoreFile); err != nil { return err