summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-05-11 10:59:40 -0500
committerJay Mundrawala <jdmundrawala@gmail.com>2015-05-11 10:59:40 -0500
commit702b638e2410ba3a473db602d0a5912355bdd76a (patch)
treed1c65d16c716ba3cf4f2650295f9e13762bb1f17
parent82ecd970d184734df63580290964f4b8f9672b21 (diff)
downloadchef-702b638e2410ba3a473db602d0a5912355bdd76a.tar.gz
Add check_resource_semantics! lifecycle method to provider
-rw-r--r--lib/chef/provider.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb
index 65a56cf726..595fed17b2 100644
--- a/lib/chef/provider.rb
+++ b/lib/chef/provider.rb
@@ -83,6 +83,9 @@ class Chef
new_resource.cookbook_name
end
+ def check_resource_semantics!
+ end
+
def load_current_resource
raise Chef::Exceptions::Override, "You must override load_current_resource in #{self.to_s}"
end
@@ -108,6 +111,8 @@ class Chef
# TODO: it would be preferable to get the action to be executed in the
# constructor...
+ check_resource_semantics!
+
# user-defined LWRPs may include unsafe load_current_resource methods that cannot be run in whyrun mode
if !whyrun_mode? || whyrun_supported?
load_current_resource