2020-09-02 04:19:57 -04:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"strings"
|
|
|
|
|
2020-12-17 16:29:25 -05:00
|
|
|
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
|
|
|
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
2020-09-02 04:19:57 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func basicStateBag(errorBuffer *strings.Builder) *multistep.BasicStateBag {
|
|
|
|
state := new(multistep.BasicStateBag)
|
2020-11-20 13:21:29 -05:00
|
|
|
state.Put("ui", &packersdk.BasicUi{
|
2020-09-02 04:19:57 -04:00
|
|
|
Reader: new(bytes.Buffer),
|
|
|
|
Writer: new(bytes.Buffer),
|
|
|
|
ErrorWriter: errorBuffer,
|
|
|
|
})
|
|
|
|
return state
|
|
|
|
}
|