2016-12-06 67 views
0

我们目前正在从shell脚本调用一个厨师食谱。厨师失败并带有自定义退出代码,如下所示。但shell脚本获取退出代码为1。所以我可以使用此自定义退出代码使外壳脚本失败。有没有办法将厨师退出代码发送到shell

FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 5) 
+0

你如何终止你的shell脚本? –

+0

你怎么称呼你的食谱?在shell脚本中包装厨师运行的目的是什么?这听起来像[XY问题](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) – Tensibai

回答

0

找到记录特定的含义这是升技哈克,尝试使用出口/ set_env PARAM ...

begin 
    <yourcode> 
rescue 
    env 'error_code' do 
     value '5' 
    end 
end 

然后访问该ENV PARAM并将其删除。

相关问题