[chef] wait attribute for execute resource


Chronological Thread 
  • From: Daneel Yaitskov < >
  • To:
  • Subject: [chef] wait attribute for execute resource
  • Date: Fri, 29 Nov 2013 23:27:41 +0400

Hi,

What do you think about another attribute for the execute resource?
It's wait or while.

Some processes as virsh start is async.
Using second execute resource is not short.

Example:

execute "virsh shutdown #{ name }" do
   only_if "virsh domstate #{ name } | grep -c running"
end

execute "while virsh domstate #{ name } | grep -q running ; do : ; done"

but with new attribute it could be

execute "virsh shutdown #{ name }" do
   only_if "virsh domstate #{ name } | grep -c running"
   wait_if  "virsh domstate #{ name } | grep -q running"
end




--
Daneel S. Yaitskov



Archive powered by MHonArc 2.6.16.

§