resolve conflicts; fix to work with hookedprovisioner which has been added since PR was made

This commit is contained in:
Megan Marsh 2018-06-07 15:35:36 -07:00
parent a5f802ec01
commit 91aa5f8bbb
3 changed files with 14 additions and 7 deletions

View File

@ -200,10 +200,18 @@ func (b *coreBuild) Run(originalUi Ui, cache Cache) ([]Artifact, error) {
if len(p.config) > 0 {
pConfig = p.config[0]
}
hookedProvisioners[i] = &HookedProvisioner{
p.provisioner,
pConfig,
p.pType,
if b.debug {
hookedProvisioners[i] = &HookedProvisioner{
&DebuggedProvisioner{Provisioner: p.provisioner},
pConfig,
p.pType,
}
} else {
hookedProvisioners[i] = &HookedProvisioner{
p.provisioner,
pConfig,
p.pType,
}
}
}

View File

@ -152,7 +152,6 @@ func (c *Core) Build(n string) (Build, error) {
Provisioner: provisioner,
}
}
if config.PackerDebug
provisioners = append(provisioners, coreBuildProvisioner{
pType: rawP.Type,

View File

@ -170,8 +170,8 @@ func (p *PausedProvisioner) provision(result chan<- error, ui Ui, comm Communica
result <- p.Provisioner.Provision(ui, comm)
}
// DebuggedProvisioner is a Provisioner implementation that wait key press before
// the provisioner is actually run.
// DebuggedProvisioner is a Provisioner implementation that waits until a key
// press before the provisioner is actually run.
type DebuggedProvisioner struct {
Provisioner Provisioner