Skip to content

Commit

Permalink
Handle different exit code on windows 2012
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-richardson committed Sep 15, 2023
1 parent 6793f63 commit 627c3a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions update/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ func (p *Provisioner) update(ctx context.Context, ui packer.Ui, comm packer.Comm
case 101:
restartPending = true
return nil
case 2147942501: //windows 2012
restartPending = true
return nil
default:
return fmt.Errorf("Windows update script exited with non-zero exit status: %d", exitStatus)
}
Expand Down Expand Up @@ -278,6 +281,8 @@ func (p *Provisioner) restart(ctx context.Context, ui packer.Ui, comm packer.Com
restartPending = false
case exitStatus == 101:
restartPending = true
case exitStatus == 2147942501: //windows 2012
restartPending = true
default:
return fmt.Errorf("Machine not yet available (exit status %d)", exitStatus)
}
Expand Down

0 comments on commit 627c3a6

Please sign in to comment.