From 107e47fe256223c8cf6cdccb10436646777bb118 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 27 Dec 2013 09:21:17 -0700 Subject: [PATCH] update commands to new user var syntax --- command/build/command.go | 4 ++-- command/inspect/command.go | 2 +- command/validate/command.go | 4 ++-- common/command/template_test.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/command/build/command.go b/command/build/command.go index 4a1e7c283..bc0567b41 100644 --- a/command/build/command.go +++ b/command/build/command.go @@ -57,7 +57,7 @@ func (c Command) Run(env packer.Environment, args []string) int { // Read the file into a byte array so that we can parse the template log.Printf("Reading template: %s", args[0]) - tpl, err := packer.ParseTemplateFile(args[0]) + tpl, err := packer.ParseTemplateFile(args[0], userVars) if err != nil { env.Ui().Error(fmt.Sprintf("Failed to parse template: %s", err)) return 1 @@ -114,7 +114,7 @@ func (c Command) Run(env packer.Environment, args []string) int { b.SetDebug(cfgDebug) b.SetForce(cfgForce) - warnings, err := b.Prepare(userVars) + warnings, err := b.Prepare() if err != nil { env.Ui().Error(err.Error()) return 1 diff --git a/command/inspect/command.go b/command/inspect/command.go index ddf51d491..cdad078be 100644 --- a/command/inspect/command.go +++ b/command/inspect/command.go @@ -34,7 +34,7 @@ func (c Command) Run(env packer.Environment, args []string) int { // Read the file into a byte array so that we can parse the template log.Printf("Reading template: %#v", args[0]) - tpl, err := packer.ParseTemplateFile(args[0]) + tpl, err := packer.ParseTemplateFile(args[0], nil) if err != nil { env.Ui().Error(fmt.Sprintf("Failed to parse template: %s", err)) return 1 diff --git a/command/validate/command.go b/command/validate/command.go index 37dd1dd84..838ba13b5 100644 --- a/command/validate/command.go +++ b/command/validate/command.go @@ -50,7 +50,7 @@ func (c Command) Run(env packer.Environment, args []string) int { // Parse the template into a machine-usable format log.Printf("Reading template: %s", args[0]) - tpl, err := packer.ParseTemplateFile(args[0]) + tpl, err := packer.ParseTemplateFile(args[0], userVars) if err != nil { env.Ui().Error(fmt.Sprintf("Failed to parse template: %s", err)) return 1 @@ -82,7 +82,7 @@ func (c Command) Run(env packer.Environment, args []string) int { // Check the configuration of all builds for _, b := range builds { log.Printf("Preparing build: %s", b.Name()) - warns, err := b.Prepare(userVars) + warns, err := b.Prepare() if len(warns) > 0 { warnings[b.Name()] = warns } diff --git a/common/command/template_test.go b/common/command/template_test.go index 47140d6a9..7ece7acae 100644 --- a/common/command/template_test.go +++ b/common/command/template_test.go @@ -17,7 +17,7 @@ func testTemplate() (*packer.Template, *packer.ComponentFinder) { ] }` - tpl, err := packer.ParseTemplate([]byte(tplData)) + tpl, err := packer.ParseTemplate([]byte(tplData), nil) if err != nil { panic(err) }