command/validate: better logging

This commit is contained in:
Mitchell Hashimoto 2013-06-18 21:10:34 -07:00
parent 7217865797
commit 0efabb66dd
1 changed files with 2 additions and 0 deletions

View File

@ -66,6 +66,7 @@ func (c Command) Run(env packer.Environment, args []string) int {
buildNames := tpl.BuildNames() buildNames := tpl.BuildNames()
builds := make([]packer.Build, 0, len(buildNames)) builds := make([]packer.Build, 0, len(buildNames))
for _, buildName := range buildNames { for _, buildName := range buildNames {
log.Printf("Creating build from template for: %s", buildName)
build, err := tpl.Build(buildName, components) build, err := tpl.Build(buildName, components)
if err != nil { if err != nil {
errs = append(errs, fmt.Errorf("Build '%s': %s", buildName, err)) errs = append(errs, fmt.Errorf("Build '%s': %s", buildName, err))
@ -77,6 +78,7 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Check the configuration of all builds // Check the configuration of all builds
for _, b := range builds { for _, b := range builds {
log.Printf("Preparing build: %s", b.Name())
err := b.Prepare() err := b.Prepare()
if err != nil { if err != nil {
errs = append(errs, fmt.Errorf("Errors validating build '%s'. %s", b.Name(), err)) errs = append(errs, fmt.Errorf("Errors validating build '%s'. %s", b.Name(), err))