On Wednesday, May 15, 2013 at 9:13 AM, Bryan Stenson wrote:
Ohai!I'm trying to catch exit codes from my powershell code block to determine whether my provider has affected change (to correctly set updated_by_last_action).I think I should be able to do this using the "returns" attribute of the Powershell LWRP, but I'm having trouble getting it to work (and I haven't found many good examples). I can see the "returns" attribute should be either an Array or Integer of acceptable exit codes, and I've set it to my expected values.However, no matter what my code block returns, Chef gets an exit code of "1" for all non-zero return codes from Mixlib::ShellOut::ShellCommandFailed.Here's my sample recipe, and chef-client run error: https://gist.github.com/stensonb/5585093Even if I successfully get a non-one error code response, how do I access this return code?I'm hoping I'm just using it wrong. Anybody have an example?Bryan
Archive powered by MHonArc 2.6.16.