From e228a5bcb9afed386f10da1967a297820ed7fa5c Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 15 Jan 2020 14:07:53 -0800 Subject: [PATCH] log name of postprocessor running to disambiguate long chains of pps --- packer/build.go | 7 ++++++- packer/core.go | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packer/build.go b/packer/build.go index 46f07e315..f1b8a11c3 100644 --- a/packer/build.go +++ b/packer/build.go @@ -109,6 +109,7 @@ type CoreBuild struct { type CoreBuildPostProcessor struct { PostProcessor PostProcessor PType string + PName string config map[string]interface{} keepInputArtifact *bool } @@ -297,7 +298,11 @@ PostProcessorRunSeqLoop: Ui: originalUi, } - builderUi.Say(fmt.Sprintf("Running post-processor: %s", corePP.PType)) + if corePP.PName == corePP.PType { + builderUi.Say(fmt.Sprintf("Running post-processor: %s", corePP.PType)) + } else { + builderUi.Say(fmt.Sprintf("Running post-processor: %s (type %s)", corePP.PName, corePP.PType)) + } ts := CheckpointReporter.AddSpan(corePP.PType, "post-processor", corePP.config) artifact, defaultKeep, forceOverride, err := corePP.PostProcessor.PostProcess(ctx, ppUi, priorArtifact) ts.End(err) diff --git a/packer/core.go b/packer/core.go index 46e6ad8eb..c32c7b318 100644 --- a/packer/core.go +++ b/packer/core.go @@ -258,6 +258,7 @@ func (c *Core) Build(n string) (Build, error) { current = append(current, CoreBuildPostProcessor{ PostProcessor: postProcessor, PType: rawP.Type, + PName: rawP.Name, config: rawP.Config, keepInputArtifact: rawP.KeepInputArtifact, })