gpt4 book ai didi

chef-infra - 覆盖 Chef bash 返回代码

转载 作者:行者123 更新时间:2023-12-02 15:49:54 24 4
gpt4 key购买 nike

我正在运行 Chef recipie 来安装 Websphere 修复包。修复包重新启动并退出代码 [2],用于部分安装。这是一种预期的行为,但 Chef 只是将其视为错误。有什么办法可以覆盖它吗?

我希望 Chef 继续执行下一个任务,即使返回退出代码是 [2]

================================================================================
Error executing action `run` on resource 'bash[was-install-fixpacks]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '2'

最佳答案

快速浏览documentation显示参数返回:

The return value for a command. This may be an array of accepted values. An exception is raised when the return value(s) do not match. Default value: 0.

示例:

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

关于chef-infra - 覆盖 Chef bash 返回代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16975299/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com