update commands to new user var syntax

This commit is contained in:
Mitchell Hashimoto 2013-12-27 09:21:17 -07:00
parent 43962ca31f
commit 107e47fe25
4 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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)
}