diff options
author | Thom May <thom@chef.io> | 2016-10-14 16:46:51 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-11-16 16:28:15 +0000 |
commit | 64b8b0efd90e59ad609ba30fe4bc7ff19e70e940 (patch) | |
tree | 779c33247a0617eed1db6b6a662635a0f91d37d3 /lib/chef/node | |
parent | bedcbd5f52448d24fdd7ab26ab79185c011beee3 (diff) | |
download | chef-64b8b0efd90e59ad609ba30fe4bc7ff19e70e940.tar.gz |
Structure deprecations with additional metadatatm/deprecation_with_url
This adds URLs to each class of deprecation, and correctly prints and
formats them for maximum user efficiency. We also provide the URL to the
data collector for Visibility to ingest.
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/node')
-rw-r--r-- | lib/chef/node/attribute.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb index 2ed32d50ad..d2816d4824 100644 --- a/lib/chef/node/attribute.rb +++ b/lib/chef/node/attribute.rb @@ -430,7 +430,7 @@ class Chef end def set_unless(*args) - Chef.log_deprecation("node.set_unless is deprecated and will be removed in Chef 14, please use node.default_unless/node.override_unless (or node.normal_unless if you really need persistence)") + Chef.deprecated(:attributes, "node.set_unless is deprecated and will be removed in Chef 14, please use node.default_unless/node.override_unless (or node.normal_unless if you really need persistence)") return Decorator::Unchain.new(self, :default_unless) unless args.length > 0 write(:normal, *args) if read(*args[0...-1]).nil? end @@ -481,14 +481,14 @@ class Chef if symbol == :to_ary merged_attributes.send(symbol, *args) elsif args.empty? - Chef.log_deprecation %q{method access to node attributes (node.foo.bar) is deprecated and will be removed in Chef 13, please use bracket syntax (node["foo"]["bar"])} + Chef.deprecated(:attributes, %q{method access to node attributes (node.foo.bar) is deprecated and will be removed in Chef 13, please use bracket syntax (node["foo"]["bar"])}) if key?(symbol) self[symbol] else raise NoMethodError, "Undefined method or attribute `#{symbol}' on `node'" end elsif symbol.to_s =~ /=$/ - Chef.log_deprecation %q{method setting of node attributes (node.foo="bar") is deprecated and will be removed in Chef 13, please use bracket syntax (node["foo"]="bar")} + Chef.deprecated(:attributes, %q{method setting of node attributes (node.foo="bar") is deprecated and will be removed in Chef 13, please use bracket syntax (node["foo"]="bar")}) key_to_set = symbol.to_s[/^(.+)=$/, 1] self[key_to_set] = (args.length == 1 ? args[0] : args) else |