builder/lxc: fix dropped error

This commit is contained in:
Lars Lehtonen 2019-11-14 13:40:40 -08:00
parent c09bb52a92
commit 59472c6aad
No known key found for this signature in database
GPG Key ID: 8137D474EBCB04F2
1 changed files with 6 additions and 1 deletions

View File

@ -53,7 +53,12 @@ func (s *stepExport) Run(ctx context.Context, state multistep.StateBag) multiste
}
_, err = io.Copy(configFile, originalConfigFile)
if err != nil {
err := fmt.Errorf("error copying file %s: %v", config.ConfigFile, err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
commands := make([][]string, 3)
commands[0] = []string{
"lxc-stop", "--name", name,