From 400faa57a58a304d0197cb93af08b9246d4ed6ec Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 1 Jul 2013 15:00:21 -0700 Subject: [PATCH] packer: Send packerConfig into PostProcessors --- packer/build.go | 3 ++- packer/build_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packer/build.go b/packer/build.go index 2aa76887f..3a16b769b 100644 --- a/packer/build.go +++ b/packer/build.go @@ -121,7 +121,8 @@ func (b *coreBuild) Prepare() (err error) { // Prepare the post-processors for _, ppSeq := range b.postProcessors { for _, corePP := range ppSeq { - if err = corePP.processor.Configure(corePP.config); err != nil { + err = corePP.processor.Configure(corePP.config, packerConfig) + if err != nil { return } } diff --git a/packer/build_test.go b/packer/build_test.go index 82e8c6e10..d7d3a9bfe 100644 --- a/packer/build_test.go +++ b/packer/build_test.go @@ -59,7 +59,7 @@ func TestBuild_Prepare(t *testing.T) { corePP := build.postProcessors[0][0] pp := corePP.processor.(*TestPostProcessor) assert.True(pp.configCalled, "config should be called") - assert.Equal(pp.configVal, []interface{}{42}, "config should have right value") + assert.Equal(pp.configVal, []interface{}{42, packerConfig}, "config should have right value") } func TestBuild_Prepare_Twice(t *testing.T) {