Cleanup some debug code and reorganize config struct

This commit is contained in:
Chris Bednarski 2015-06-18 14:01:00 -07:00
parent f06847ff10
commit 0880d448f0
1 changed files with 11 additions and 10 deletions

View File

@ -21,13 +21,17 @@ import (
type Config struct { type Config struct {
common.PackerConfig `mapstructure:",squash"` common.PackerConfig `mapstructure:",squash"`
OutputPath string `mapstructure:"output"`
CompressionLevel int `mapstructure:"compression_level"` // Fields from config file
KeepInputArtifact bool `mapstructure:"keep_input_artifact"` OutputPath string `mapstructure:"output"`
Archive string CompressionLevel int `mapstructure:"compression_level"`
Algorithm string KeepInputArtifact bool `mapstructure:"keep_input_artifact"`
UsingDefault bool
ctx *interpolate.Context // Derived fields
Archive string
Algorithm string
ctx *interpolate.Context
} }
type PostProcessor struct { type PostProcessor struct {
@ -54,8 +58,6 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
}, },
}, raws...) }, raws...)
fmt.Printf("CompressionLevel: %d\n", p.config.CompressionLevel)
errs := new(packer.MultiError) errs := new(packer.MultiError)
if p.config.OutputPath == "" { if p.config.OutputPath == "" {
@ -81,7 +83,6 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
p.config.CompressionLevel = pgzip.DefaultCompression p.config.CompressionLevel = pgzip.DefaultCompression
} }
fmt.Printf("CompressionLevel: %d\n", p.config.CompressionLevel)
for key, ptr := range templates { for key, ptr := range templates {
if *ptr == "" { if *ptr == "" {
errs = packer.MultiErrorAppend( errs = packer.MultiErrorAppend(