Reload node attributes


#1

Hi all!

Is there any valid way to reload all node attributes from recipe

I’m running a rather complicated setup and I’m stuck into problem
Two chef-clients are starting at two nodes at the same time. One node
should wait for second one. The second will hang an attribute, which
the first is polling.

Something like this:
def wait_for n, attrib, timeout=300, timechunk=10
if n
sttime=Time.now.to_f
Chef::Log.info "Starting to wait #{n.name}[:#{attrib}]…"
until n.attribute?(attrib) do
if (Time.now.to_f-sttime)>=timeout
Chef::Log.error "Timeout exceeded while waiting
for #{n}[:#{attrib}]…"
exit 1
else
sleep timechunk
end
end
Chef::Log.info "Got #{n[:name]}[:#{attrib}]…"
else
Chef::Log.error "Invalid node!"
exit 1
end

end

The problem is - ‘n’ doesn’t update. Is there a method to read it again?


With best regards
Eugene Suchkov