Skip to content

Commit

Permalink
Merge pull request #134 from mattr/handle-2012-exit-code
Browse files Browse the repository at this point in the history
Handle different exit code on windows 2012
  • Loading branch information
rgl committed Dec 17, 2023
2 parents 6793f63 + 627c3a6 commit 7ab2bdb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions update/provisioner.go
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 7ab2bdb

Please sign in to comment.