diff options
Diffstat (limited to 'lib/chef/resource/powershell_script.rb')
-rw-r--r-- | lib/chef/resource/powershell_script.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/chef/resource/powershell_script.rb b/lib/chef/resource/powershell_script.rb index 08568b6964..f053d0b2aa 100644 --- a/lib/chef/resource/powershell_script.rb +++ b/lib/chef/resource/powershell_script.rb @@ -36,16 +36,18 @@ class Chef ) end - def only_if(command=nil, opts={}, &block) - augmented_opts = opts.merge((guard_interpreter.nil? || guard_interpreter == :default) ? {} : {:convert_boolean_return => true}) {|key, original_value, augmented_value| original_value} - super(command, augmented_opts, &block) - end + protected - def not_if(command=nil, opts={}, &block) - augmented_opts = opts.merge((guard_interpreter.nil? || guard_interpreter == :default) ? {} : {:convert_boolean_return => true}) {|key, original_value, augmented_value| original_value} - super(command, augmented_opts, &block) + # Allow callers evaluating guards to request default + # attribute values. This is needed to allow + # convert_boolean_return to be true in guard context by default, + # and false by default otherwise. When this mode becomes the + # default for this resource, this method can be removed since + # guard context and recipe resource context will have the + # same behavior. + def self.get_default_attributes(opts) + {:convert_boolean_return => true} end - end end end |