|
|
|
|
@ -5,6 +5,7 @@ import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"github.com/mitchellh/multistep"
|
|
|
|
|
"github.com/mitchellh/packer/packer"
|
|
|
|
|
"log"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// This step uploads a file containing the VirtualBox version, which
|
|
|
|
|
@ -17,6 +18,11 @@ func (s *stepUploadVersion) Run(state map[string]interface{}) multistep.StepActi
|
|
|
|
|
driver := state["driver"].(Driver)
|
|
|
|
|
ui := state["ui"].(packer.Ui)
|
|
|
|
|
|
|
|
|
|
if config.VBoxVersionFile == "" {
|
|
|
|
|
log.Println("VBoxVersionFile is empty. Not uploading.")
|
|
|
|
|
return multistep.ActionContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
version, err := driver.Version()
|
|
|
|
|
if err != nil {
|
|
|
|
|
state["error"] = fmt.Errorf("Error reading version for metadata upload: %s", err)
|
|
|
|
|
|