diff options
author | John Keiser <john@johnkeiser.com> | 2015-08-31 14:38:50 -0700 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-09-01 19:30:43 -0700 |
commit | 25dac92eeb1ffa83ec549bfed0b19672c5847d80 (patch) | |
tree | f5292bfb261d40f1bbe3bdfa2845de87245f78d4 /lib/chef/dsl/resources.rb | |
parent | ad8fd4d65b48519ac154ad9bf9774322b0c6d902 (diff) | |
download | chef-25dac92eeb1ffa83ec549bfed0b19672c5847d80.tar.gz |
Pass deprecations through formatter instead of logs
Diffstat (limited to 'lib/chef/dsl/resources.rb')
-rw-r--r-- | lib/chef/dsl/resources.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/dsl/resources.rb b/lib/chef/dsl/resources.rb index f15beaeab0..8e75223b0d 100644 --- a/lib/chef/dsl/resources.rb +++ b/lib/chef/dsl/resources.rb @@ -11,14 +11,14 @@ class Chef begin module_eval(<<-EOM, __FILE__, __LINE__+1) def #{dsl_name}(*args, &block) - Chef::Log.deprecation("Cannot create resource #{dsl_name} with more than one argument. All arguments except the name (\#{args[0].inspect}) will be ignored. This will cause an error in Chef 13. Arguments: \#{args}") if args.size > 1 + Chef.log.deprecation("Cannot create resource #{dsl_name} with more than one argument. All arguments except the name (\#{args[0].inspect}) will be ignored. This will cause an error in Chef 13. Arguments: \#{args}") if args.size > 1 declare_resource(#{dsl_name.inspect}, args[0], caller[0], &block) end EOM rescue SyntaxError # Handle the case where dsl_name has spaces, etc. define_method(dsl_name.to_sym) do |*args, &block| - Chef::Log.deprecation("Cannot create resource #{dsl_name} with more than one argument. All arguments except the name (#{args[0].inspect}) will be ignored. This will cause an error in Chef 13. Arguments: #{args}") if args.size > 1 + Chef.log.deprecation("Cannot create resource #{dsl_name} with more than one argument. All arguments except the name (#{args[0].inspect}) will be ignored. This will cause an error in Chef 13. Arguments: #{args}") if args.size > 1 declare_resource(dsl_name, args[0], caller[0], &block) end end |