From 0bdd358decddf4251c20ced1eb48e54057eb2418 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 1 Jul 2016 11:25:29 -0700 Subject: 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 --- lib/chef/property.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/chef/property.rb') 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 -- cgit v1.2.1