diff options
author | danielsdeleo <dan@getchef.com> | 2015-02-11 12:07:23 -0800 |
---|---|---|
committer | danielsdeleo <dan@getchef.com> | 2015-02-11 12:07:23 -0800 |
commit | d19fa385eed8f96b5e851d0ffee71c141c5cbe8e (patch) | |
tree | 45a50361f4bb7107ea8c096be502c3970cdf10b1 /lib/chef | |
parent | 3544a2a32e8a4ce99a3e39e4a1810578c9773785 (diff) | |
download | chef-d19fa385eed8f96b5e851d0ffee71c141c5cbe8e.tar.gz |
Remove deprecations for Cookbook Version HTTP resource behaviors
We cannot determine the best way to organize various CookbookManifest
formats ahead of time, so we make the CookbookManifest API private, and
un-deprecate the methods in CookbookVersion that delegate to
CookbookManifest. We'll re-deprecate these when we have a stable public
API for CookbookManifest behaviors.
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/cookbook_manifest.rb | 5 | ||||
-rw-r--r-- | lib/chef/cookbook_version.rb | 29 |
2 files changed, 9 insertions, 25 deletions
diff --git a/lib/chef/cookbook_manifest.rb b/lib/chef/cookbook_manifest.rb index 30f8596b39..4f80203ccf 100644 --- a/lib/chef/cookbook_manifest.rb +++ b/lib/chef/cookbook_manifest.rb @@ -46,6 +46,11 @@ class Chef # cookbook_version in the "manifest" format, or #to_json to get a JSON # representation of the cookbook_version. # + # The inferface for this behavior is expected to change as we implement new + # manifest formats. The entire class should be considered a private API for + # now. + # + # @api private # @param policy_mode [Boolean] whether to convert cookbooks to Hash/JSON in # the format used by the `cookbook_artifacts` endpoint (for policyfiles). # Setting this option also changes the behavior of #save_url and diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb index 5fa00470d0..c51d5798c5 100644 --- a/lib/chef/cookbook_version.rb +++ b/lib/chef/cookbook_version.rb @@ -474,22 +474,12 @@ class Chef def to_hash - Chef::Log.deprecation(<<-DEPRECATED) -Cookbooks now have multiple JSON representations based on the capabilities of the Chef Server. -To get the Hash representation, use code like `Chef::CookbookManifest.new(cookbook_version).to_hash` - -Called from #{caller(1).first} -DEPRECATED + # TODO: this should become deprecated when the API for CookbookManifest becomes stable cookbook_manifest.to_hash end def to_json(*a) - Chef::Log.deprecation(<<-DEPRECATED) -Cookbooks now have multiple JSON representations based on the capabilities of the Chef Server. -To get the JSON representation, use code like `Chef::CookbookManifest.new(cookbook_version).to_json` - -Called from #{caller(1).first} -DEPRECATED + # TODO: this should become deprecated when the API for CookbookManifest becomes stable cookbook_manifest.to_json end @@ -513,23 +503,12 @@ DEPRECATED ## def save_url - Chef::Log.deprecation(<<-DEPRECATED) -Cookbooks now have multiple save URLs based on the capabilities of the Chef Server. -To get the default save URL, use code like `Chef::CookbookManifest.new(cookbook_version).save_url` - -Called from #{caller(1).first} -DEPRECATED - + # TODO: this should become deprecated when the API for CookbookManifest becomes stable cookbook_manifest.save_url end def force_save_url - Chef::Log.deprecation(<<-DEPRECATED) -Cookbooks now have multiple save URLs based on the capabilities of the Chef Server. -To get the default save URL, use code like `Chef::CookbookManifest.new(cookbook_version).force_save_url` - -Called from #{caller(1).first} -DEPRECATED + # TODO: this should become deprecated when the API for CookbookManifest becomes stable cookbook_manifest.force_save_url end |