diff options
author | Thom May <thom@chef.io> | 2016-01-19 14:47:55 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-01-19 14:47:55 +0000 |
commit | 3458740dc59959e0eaa88543883756d041435d56 (patch) | |
tree | 86c5f759dbe18608a9133547f823c2f35b175fce /lib | |
parent | c48d37e27953ebb8435ec298caf59de1909f63e6 (diff) | |
download | chef-3458740dc59959e0eaa88543883756d041435d56.tar.gz |
deprecate a few more callstm/rest_deprecation
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/key.rb | 5 | ||||
-rw-r--r-- | lib/chef/org.rb | 5 | ||||
-rw-r--r-- | lib/chef/user.rb | 5 | ||||
-rw-r--r-- | lib/chef/user_v1.rb | 5 |
4 files changed, 12 insertions, 8 deletions
diff --git a/lib/chef/key.rb b/lib/chef/key.rb index ba5613e35e..141a444d57 100644 --- a/lib/chef/key.rb +++ b/lib/chef/key.rb @@ -222,8 +222,9 @@ class Chef Chef::Key.from_hash(Chef::JSONCompat.from_json(json)) end - class << self - alias_method :json_create, :from_json + def self.json_create(json) + Chef.log_deprecation("Auto inflation of JSON data is deprecated. Please use Chef::Key#from_json or one of the load_by methods.") + Chef::Key.from_json(json) end def self.list_by_user(actor, inflate=false) diff --git a/lib/chef/org.rb b/lib/chef/org.rb index 33a986dc3b..434113e315 100644 --- a/lib/chef/org.rb +++ b/lib/chef/org.rb @@ -124,8 +124,9 @@ class Chef Chef::Org.from_hash(Chef::JSONCompat.from_json(json)) end - class <<self - alias_method :json_create, :from_json + def self.json_create(json) + Chef.log_deprecation("Auto inflation of JSON data is deprecated. Please use Chef::Org#from_json or Chef::Org#load.") + Chef::Org.from_json(json) end def self.load(org_name) diff --git a/lib/chef/user.rb b/lib/chef/user.rb index 37a104a537..bcbce76bf2 100644 --- a/lib/chef/user.rb +++ b/lib/chef/user.rb @@ -154,8 +154,9 @@ class Chef Chef::User.from_hash(Chef::JSONCompat.from_json(json)) end - class << self - alias_method :json_create, :from_json + def self.json_create(json) + Chef.log_deprecation("Auto inflation of JSON data is deprecated. Please use Chef::User#from_json or Chef::User#load.") + Chef::User.from_json(json) end def self.list(inflate=false) diff --git a/lib/chef/user_v1.rb b/lib/chef/user_v1.rb index 133087a089..bb594e3564 100644 --- a/lib/chef/user_v1.rb +++ b/lib/chef/user_v1.rb @@ -276,8 +276,9 @@ class Chef Chef::UserV1.from_hash(Chef::JSONCompat.from_json(json)) end - class << self - alias_method :json_create, :from_json + def self.json_create(json) + Chef.log_deprecation("Auto inflation of JSON data is deprecated. Please use Chef::UserV1#from_json or Chef::UserV1#load.") + Chef::UserV1.from_json(json) end def self.list(inflate=false) |