summaryrefslogtreecommitdiff
path: root/lib/chef/environment.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-01-18 15:14:31 +0000
committerThom May <thom@chef.io>2016-01-18 15:14:31 +0000
commit0ef0ab07531ae78cb4052242037227b0fb5365dc (patch)
tree64100fafb9164d7af2f94475c28a53f65c9b422f /lib/chef/environment.rb
parent808fe8b34254c2747d333205f7f7cdb4224cf8aa (diff)
downloadchef-0ef0ab07531ae78cb4052242037227b0fb5365dc.tar.gz
add deprecation warnings
Diffstat (limited to 'lib/chef/environment.rb')
-rw-r--r--lib/chef/environment.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/environment.rb b/lib/chef/environment.rb
index e41f2b66ac..042cde5bd5 100644
--- a/lib/chef/environment.rb
+++ b/lib/chef/environment.rb
@@ -217,6 +217,7 @@ class Chef
end
def self.json_create(o)
+ Chef.log_deprecation("Auto inflation of JSON data is deprecated. Please use Chef::Environment#from_hash")
from_hash(o)
end
@@ -260,7 +261,8 @@ class Chef
if File.exists?(js_file)
# from_json returns object.class => json_class in the JSON.
- Chef::JSONCompat.from_json(IO.read(js_file))
+ hash = Chef::JSONCompat.parse(IO.read(js_file))
+ from_hash(hash)
elsif File.exists?(rb_file)
environment = Chef::Environment.new
environment.name(name)