summaryrefslogtreecommitdiff
path: root/lib/chef/property.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-07-01 11:25:29 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-07-01 11:25:29 -0700
commit0bdd358decddf4251c20ced1eb48e54057eb2418 (patch)
tree8b14ee89ad80558f59b8acea81ef6e7c5863f1fd /lib/chef/property.rb
parenta39ae423bbfc72f4b26c4ed2435c4b625e176e6e (diff)
downloadchef-0bdd358decddf4251c20ced1eb48e54057eb2418.tar.gz
tweak 3694 warnings
- clean up "ZenMaster" resource - clean up 3694 detection to use properties - unlazy the resource_name in the trivial resource check - fixes an issue with resources-as-definitions pattern emitting 3694 errors for trivial resources
Diffstat (limited to 'lib/chef/property.rb')
-rw-r--r--lib/chef/property.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/property.rb b/lib/chef/property.rb
index 45ab4dd522..0589cb4c54 100644
--- a/lib/chef/property.rb
+++ b/lib/chef/property.rb
@@ -531,8 +531,6 @@ class Chef
end
end
- protected
-
#
# The options this Property will use for get/set behavior and validation.
#
@@ -583,6 +581,7 @@ class Chef
(options.has_key?(:is) && resource.send(:_pv_is, { name => nil }, name, options[:is], raise_error: false))
end
+ # @api private
def get_value(resource)
if instance_variable_name
resource.instance_variable_get(instance_variable_name)
@@ -591,6 +590,7 @@ class Chef
end
end
+ # @api private
def set_value(resource, value)
if instance_variable_name
resource.instance_variable_set(instance_variable_name, value)
@@ -599,6 +599,7 @@ class Chef
end
end
+ # @api private
def value_is_set?(resource)
if instance_variable_name
resource.instance_variable_defined?(instance_variable_name)
@@ -607,6 +608,7 @@ class Chef
end
end
+ # @api private
def reset_value(resource)
if instance_variable_name
if value_is_set?(resource)
@@ -617,6 +619,8 @@ class Chef
end
end
+ private
+
def exec_in_resource(resource, proc, *args)
if resource
if proc.arity > args.size