Merge pull request #5864 from hashicorp/workaround_5257

add workaround for azure bug.
This commit is contained in:
Matthew Hooker 2018-02-07 13:38:53 -08:00 committed by GitHub
commit 51dcf9ffb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -114,6 +114,12 @@ var waitForRestart = func(p *Provisioner, comm packer.Communicator) error {
var cmd *packer.RemoteCmd var cmd *packer.RemoteCmd
trycommand := TryCheckReboot trycommand := TryCheckReboot
abortcommand := AbortReboot abortcommand := AbortReboot
// This sleep works around an azure/winrm bug. For more info see
// https://github.com/hashicorp/packer/issues/5257; we can remove the
// sleep when the underlying bug has been resolved.
time.Sleep(1 * time.Second)
// Stolen from Vagrant reboot checker // Stolen from Vagrant reboot checker
for { for {
log.Printf("Check if machine is rebooting...") log.Printf("Check if machine is rebooting...")