From 23803621e98fce54384bd5894c498fabfafbbaba Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 8 Aug 2013 17:04:46 -0700 Subject: [PATCH] provisioner/shell: tests passing and compiling --- provisioner/shell/provisioner.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/provisioner/shell/provisioner.go b/provisioner/shell/provisioner.go index 23eed60d6..fb30422e5 100644 --- a/provisioner/shell/provisioner.go +++ b/provisioner/shell/provisioner.go @@ -4,7 +4,6 @@ package shell import ( "bufio" - "bytes" "errors" "fmt" "github.com/mitchellh/packer/common" @@ -231,10 +230,13 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { flattendVars := strings.Join(envVars, " ") // Compile the command - command := p.config.tpl.Process(p.config.ExecuteCommand, &ExecuteCommandTemplate{ + command, err := p.config.tpl.Process(p.config.ExecuteCommand, &ExecuteCommandTemplate{ Vars: flattendVars, Path: p.config.RemotePath, }) + if err != nil { + return fmt.Errorf("Error processing command: %s", err) + } cmd := &packer.RemoteCmd{Command: command} log.Printf("Executing command: %s", cmd.Command)