mirror of
https://github.com/hashicorp/packer.git
synced 2026-02-28 12:31:32 -05:00
fix: updates to have make fmt-check and ci-lint pass
This commit is contained in:
parent
000ace61a3
commit
d00a41c6ae
2 changed files with 9 additions and 8 deletions
|
|
@ -354,11 +354,9 @@ func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packe
|
|||
log.Printf("remote cleanup script failed to upload; skipping the removal of temporary files: %s; ", strings.Join(uploadedScripts, ","))
|
||||
}
|
||||
|
||||
if p.config.PauseAfter != 0 { ui.Say(fmt.Sprintf("Pausing %s after this provisioner...", p.config.PauseAfter))
|
||||
select {
|
||||
case <-time.After(p.config.PauseAfter):
|
||||
return nil
|
||||
}
|
||||
if p.config.PauseAfter != 0 {
|
||||
ui.Say(fmt.Sprintf("Pausing %s after this provisioner...", p.config.PauseAfter))
|
||||
time.Sleep(p.config.PauseAfter)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -395,14 +395,17 @@ func TestProvisionerProvision_PauseAfter(t *testing.T) {
|
|||
p.config.PackerBuildName = "vmware"
|
||||
p.config.PackerBuilderType = "iso"
|
||||
p.config.ValidExitCodes = []int{0, 200}
|
||||
pause_amount := time.Duration(1 * time.Second)
|
||||
pause_amount := time.Second
|
||||
p.config.PauseAfter = pause_amount
|
||||
comm := new(packersdk.MockCommunicator)
|
||||
comm.StartExitStatus = 200
|
||||
p.Prepare(config)
|
||||
err := p.Prepare(config)
|
||||
if err != nil {
|
||||
t.Fatalf("Prepar failed: %s", err)
|
||||
}
|
||||
|
||||
start_time := time.Now()
|
||||
err := p.Provision(context.Background(), ui, comm, generatedData())
|
||||
err = p.Provision(context.Background(), ui, comm, generatedData())
|
||||
end_time := time.Now()
|
||||
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue