gpt4 book ai didi

ruby - Chef - 从 LWRP 中的其他操作调用操作

转载 作者:数据小太阳 更新时间:2023-10-29 08:36:25 25 4
gpt4 key购买 nike

我正在定义一个提供者如下:

action :start do
...
end

action :stop do
...
end

action :restart do
...
end

现在我不想在 restart 中重写 stopstart 的实现,而是调用 action :stop 然后 action :startaction :restart 中,像这样:

action :restart do
action :stop
action :start
end

有办法实现吗?

编辑 - 如Coderanger answer中所述,解决方案是:

action :restart do 
action_stop
action_start
end

最佳答案

调用action_startaction_stop

关于ruby - Chef - 从 LWRP 中的其他操作调用操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35690799/

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