Skip to content

Commit f4b0b8e

Browse files
committed
Allow RFC062 Exit Codes
Signed-off-by: Brian Dwyer <bdwyer@IEEE.org>
1 parent cb55748 commit f4b0b8e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

builtin/provisioners/chef/resource_provisioner.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,16 @@ func (p *provisioner) runCommand(o terraform.UIOutput, comm communicator.Communi
703703
}
704704

705705
if err := cmd.Wait(); err != nil {
706-
return err
706+
// Allow RFC062 Exit Codes
707+
// https://github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md
708+
switch cmd.ExitStatus {
709+
case 35:
710+
o.Output("Reboot has been scheduled in the run state")
711+
case 37:
712+
o.Output("Reboot needs to be completed")
713+
default:
714+
return err
715+
}
707716
}
708717

709718
return nil

0 commit comments

Comments
 (0)