knife-vsphere icon indicating copy to clipboard operation
knife-vsphere copied to clipboard

return non zero with when bootstrap errors?

Open dmead opened this issue 9 years ago • 3 comments

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?

dmead avatar Jun 23 '15 17:06 dmead

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.

swalberg avatar Jul 01 '15 14:07 swalberg

cool. is there anything you need from me to help? versions, configuration listings etc?

dmead avatar Jul 01 '15 15:07 dmead

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.

swalberg avatar Jul 01 '15 16:07 swalberg