knife-vsphere
knife-vsphere copied to clipboard
return non zero with when bootstrap errors?
Hi
is it possible to get knife to exit with a non zero return code when a recipe errors out? I've got some automation clue that calls knife. it catches non zero return codes when knife itself has a problem, but any errors in the recipes aren't propagated back to the knife call. is this by design or am I doing something wrong?
Hi, I don't think you're doing anything wrong and this isn't intended behaviour.
I was poking around in the code and didn't see an obvious way to do it as we delegate a lot of the bootstrap functionality to the Chef code, which sends it off to ssh. So I'm not 100% sure now if this is a knife problem or a knife-vsphere problem.
This is a bug though and I'll try to give it some more analysis.
cool. is there anything you need from me to help? versions, configuration listings etc?
I don't think so. I know the problem is there and how to reproduce it on Linux, at least.
If anyone is reading that wants to tackle this, I'd start by checking out the return code from https://github.com/ezrapagel/knife-vsphere/blob/master/lib/chef/knife/vsphere_vm_clone.rb#L364 -- that's where we hand the show over to Chef.