Commit 0880d448 authored by Chris Bednarski's avatar Chris Bednarski

Cleanup some debug code and reorganize config struct

parent f06847ff
...@@ -21,12 +21,16 @@ import ( ...@@ -21,12 +21,16 @@ import (
type Config struct { type Config struct {
common.PackerConfig `mapstructure:",squash"` common.PackerConfig `mapstructure:",squash"`
// Fields from config file
OutputPath string `mapstructure:"output"` OutputPath string `mapstructure:"output"`
CompressionLevel int `mapstructure:"compression_level"` CompressionLevel int `mapstructure:"compression_level"`
KeepInputArtifact bool `mapstructure:"keep_input_artifact"` KeepInputArtifact bool `mapstructure:"keep_input_artifact"`
// Derived fields
Archive string Archive string
Algorithm string Algorithm string
UsingDefault bool
ctx *interpolate.Context ctx *interpolate.Context
} }
...@@ -54,8 +58,6 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { ...@@ -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 { ...@@ -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(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment