[chef] Catch (return -1) in a batch script


Chronological Thread 
  • From: Carlos Camacho < >
  • To: " " < >
  • Subject: [chef] Catch (return -1) in a batch script
  • Date: Wed, 10 Sep 2014 11:26:39 +0200

Hello, im executing a Chef batch script and im receiving -1 as the command output. In my case this is an expected output.

Is there a way to catch the error from the script and accept it, so the recipe wont fail?


This is the command output:
STDERR: The IIS Web Site was extended with Windows SharePoint Services, but the following error occurs in creating the default site "http://xxx:8080/". Please correct the input and try to create the default site again. Error: Another site already exists at http://xxx:8080. Delete this site before attempting to create a new site with the same URL, choose a new URL, or create a new inclusion at the path you originally specified.


The chef-client output:
---- End output of "cmd.exe" /c "C:/Users/CARLOS~1.CAM/AppData/Local/Temp/2/chef-script20140910-3376-a8uhvi.bat" ----
Ran "cmd.exe" /c "C:/Users/CARLOS~1.CAM/AppData/Local/Temp/2/chef-script20140910-3376-a8uhvi.bat" returned -1


Cheers,







Archive powered by MHonArc 2.6.16.

§