Class: Chef::Resource
- Inherits:
-
Object
- Object
- Chef::Resource
- Defined in:
- lib/chef/undev/monkey_patches/load_prior_resource.rb
Instance Method Summary collapse
Instance Method Details
#load_prior_resource ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/chef/undev/monkey_patches/load_prior_resource.rb', line 5 def load_prior_resource begin prior_resource = run_context.resource_collection.lookup(self.to_s) prior_resource.instance_variables.each do |iv| unless iv.to_sym == :@source_line || iv.to_sym == :@action || iv.to_sym == :@not_if || iv.to_sym == :@only_if self.instance_variable_set(iv, prior_resource.instance_variable_get(iv)) end end true rescue Chef::Exceptions::ResourceNotFound true end end |