Megan Marsh a0edaf6c46 Going to revert this change for now, becuase of potential issues that arise from calling Prepare() twice
Revert "use statebag instead of SetSharedState for winRM password"

This reverts commit b35acbd8798a1baa645f0d181731a9cd9318a61c.
2018-09-10 16:48:42 -07:00

38 lines
646 B
Go

package shell
import (
sl "github.com/hashicorp/packer/common/shell-local"
"github.com/hashicorp/packer/packer"
)
type Provisioner struct {
config sl.Config
}
func (p *Provisioner) Prepare(raws ...interface{}) error {
err := sl.Decode(&p.config, raws...)
if err != nil {
return err
}
err = sl.Validate(&p.config)
if err != nil {
return err
}
return nil
}
func (p *Provisioner) Provision(ui packer.Ui, _ packer.Communicator) error {
_, retErr := sl.Run(ui, &p.config)
if retErr != nil {
return retErr
}
return nil
}
func (p *Provisioner) Cancel() {
// Just do nothing. When the process ends, so will our provisioner
}