149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
# File 'lib/chef/resource.rb', line 149
def load_prior_resource
begin
prior_resource = run_context.resource_collection.lookup(self.to_s)
Chef::Log.debug("Setting #{self.to_s} to the state of the prior #{self.to_s}")
prior_resource.instance_variables.each do |iv|
unless iv.to_sym == :@source_line || iv.to_sym == :@action
self.instance_variable_set(iv, prior_resource.instance_variable_get(iv))
end
end
true
rescue Chef::Exceptions::ResourceNotFound => e
true
end
end
|