fix: выход если ошибка в Ansible
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user