Override bash chef return code

I am running a chef recipe to install Websphere hotfixes. Fixed bug retraps and exitcode [2], which is intended for partial installation. His expected behavior, but the chef just perceives it as a mistake. Is there a way to override it.

I want the chef to move forward with the next task, even if the exit code is return [2]

================================================================================ Error executing action `run` on resource 'bash[was-install-fixpacks]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed ------------------------------------ Expected process to exit with [0], but received '2' 
+6
source share
1 answer

A quick look at the documentation shows the returns parameter:

The return value for the command. It can be an array of accepted values. An exception occurs when the return values ​​do not match. The default value is 0.

Example:

 bash "was-install-fixpacks" do command .. returns [0, 2] end 
+12
source

Source: https://habr.com/ru/post/946738/