packer-cn/builder/proxmox/step_success.go
Adrien Delorme d2f036ec44 Revert "Revert "Merge pull request #7391 from carlpett/proxmox-builder""
This reverts commit 032527ecfe2c5a9fcbe32c63cdf7755f2777df88.
2019-04-12 12:26:34 +02:00

23 lines
615 B
Go

package proxmox
import (
"context"
"github.com/hashicorp/packer/helper/multistep"
)
// stepSuccess runs after the full build has succeeded.
//
// It sets the success state, which ensures cleanup does not remove the finished template
type stepSuccess struct{}
func (s *stepSuccess) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
// We need to ensure stepStartVM.Cleanup doesn't delete the template (no
// difference between VMs and templates when deleting)
state.Put("success", true)
return multistep.ActionContinue
}
func (s *stepSuccess) Cleanup(state multistep.StateBag) {}