decode data interface into generatedData
This commit is contained in:
parent
f4c3501af5
commit
ee336e6d12
|
@ -6,6 +6,8 @@ import (
|
|||
"log"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/packer/helper/config"
|
||||
)
|
||||
|
||||
// A provisioner is responsible for installing and configuring software
|
||||
|
@ -60,10 +62,13 @@ func (h *ProvisionHook) Run(ctx context.Context, name string, ui Ui, comm Commun
|
|||
}
|
||||
|
||||
generatedData := NewProvisionHookData()
|
||||
if data != nil {
|
||||
generatedData = data.(ProvisionHookData)
|
||||
err := config.Decode(&generatedData, &config.DecodeOpts{Interpolate: false}, data)
|
||||
if err != nil {
|
||||
log.Printf("Failed to decode provisioner generated data: %s", err)
|
||||
}
|
||||
|
||||
log.Printf("Megan decoded data: %#v", generatedData)
|
||||
|
||||
if comm == nil {
|
||||
return fmt.Errorf(
|
||||
"No communicator found for provisioners! This is usually because the\n" +
|
||||
|
|
Loading…
Reference in New Issue