update commands to new user var syntax
This commit is contained in:
parent
43962ca31f
commit
107e47fe25
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue