mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-22 16:01:43 -04:00
don't need this in a loop
This commit is contained in:
@@ -175,6 +175,13 @@ WaitLoop:
|
||||
|
||||
var waitForCommunicator = func(p *Provisioner) error {
|
||||
runCustomRestartCheck := true
|
||||
if p.config.RestartCheckCommand == DefaultRestartCheckCommand {
|
||||
runCustomRestartCheck = false
|
||||
}
|
||||
// this is the user configurable command
|
||||
cmdRestartCheck := &packer.RemoteCmd{Command: p.config.RestartCheckCommand}
|
||||
log.Printf("Checking that communicator is connected with: '%s'",
|
||||
cmdRestartCheck.Command)
|
||||
for {
|
||||
select {
|
||||
case <-p.cancel:
|
||||
@@ -183,16 +190,8 @@ var waitForCommunicator = func(p *Provisioner) error {
|
||||
case <-time.After(retryableSleep):
|
||||
}
|
||||
if runCustomRestartCheck == true {
|
||||
if p.config.RestartCheckCommand == DefaultRestartCheckCommand {
|
||||
runCustomRestartCheck = false
|
||||
}
|
||||
// this is the user configurable command
|
||||
cmdRestartCheck := &packer.RemoteCmd{Command: p.config.RestartCheckCommand}
|
||||
log.Printf("Checking that communicator is connected with: '%s'",
|
||||
cmdRestartCheck.Command)
|
||||
// run user-configured restart check
|
||||
err := cmdRestartCheck.StartWithUi(p.comm, p.ui)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("Communication connection err: %s", err)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user