Make sure we use MaxRetries correctly
Make sure we use MaxRetries correctly

Even if MaxRetries is 0, we should still execute the loop one time in
order to run the Chef-Client at least once. Also waiting only makes
sense when we have `attempts` left. And last but not least we want to
exit immediately when the exit code is not in the retry list.

So this PR fixes three small issues to make everything work as
expected.

pryorda/terraform,pryorda/terraform,pdecat/terraform,hashicorp/terraform,ewbankkit/terraform,tommynsong/terraform,tommynsong/terraform,rnaveiras/terraform,ewbankkit/terraform,tommynsong/terraform,apparentlymart/terraform,VladRassokhin/terraform,apparentlymart/terraform,VladRassokhin/terraform,pdecat/terraform,rnaveiras/terraform,hashicorp/terraform,apparentlymart/terraform,rnaveiras/terraform,pryorda/terraform,apparentlymart/terraform,apparentlymart/terraform,pdecat/terraform,hashicorp/terraform,VladRassokhin/terraform,ewbankkit/terraform,ewbankkit/terraform,VladRassokhin/terraform,pdecat/terraform