From 0276680da06f988ca742dc52621e4e95f51b005a Mon Sep 17 00:00:00 2001 From: Voomra Date: Sun, 19 Jan 2025 15:31:08 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B2=D1=8B=D1=85=D0=BE=D0=B4=20=D0=B5?= =?UTF-8?q?=D1=81=D0=BB=D0=B8=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B2=20Ansible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/root.go | 2 +- internal/space_worker/restore.go | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) 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