From 494de6eea80595bd44d98fac6cd2560d1a5731cc Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 28 Feb 2018 12:57:27 -0800 Subject: Remove the :uninstall action from chocolatey_package - CHEF-21 Remove the previously deprecated :uninstall action for chocolatey_package. This is noted in CHEF-21 Signed-off-by: Tim Smith --- lib/chef/provider/package/chocolatey.rb | 8 -------- lib/chef/resource/chocolatey_package.rb | 2 +- spec/unit/provider/package/chocolatey_spec.rb | 13 ------------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb index 3536d807ad..2932654962 100644 --- a/lib/chef/provider/package/chocolatey.rb +++ b/lib/chef/provider/package/chocolatey.rb @@ -124,14 +124,6 @@ EOS choco_command("uninstall -y", cmd_args(include_source: false), *names) end - # Support :uninstall as an action in order for users to easily convert - # from the `chocolatey` provider in the cookbook. It is, however, - # already deprecated. - def action_uninstall - Chef::Log.deprecation "The use of action :uninstall on the chocolatey_package provider is deprecated, please use :remove" - action_remove - end - # Choco does not have dpkg's distinction between purge and remove alias purge_package remove_package diff --git a/lib/chef/resource/chocolatey_package.rb b/lib/chef/resource/chocolatey_package.rb index c5a5d827a2..dbd72b9dc7 100644 --- a/lib/chef/resource/chocolatey_package.rb +++ b/lib/chef/resource/chocolatey_package.rb @@ -28,7 +28,7 @@ class Chef " on the Microsoft Windows platform." introduced "12.7" - allowed_actions :install, :upgrade, :remove, :uninstall, :purge, :reconfig + allowed_actions :install, :upgrade, :remove, :purge, :reconfig # windows can't take Array options yet property :options, String diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb index afc068041d..ff9dc3ca6b 100644 --- a/spec/unit/provider/package/chocolatey_spec.rb +++ b/spec/unit/provider/package/chocolatey_spec.rb @@ -439,19 +439,6 @@ munin-node|1.6.1.20130823 expect(new_resource).to be_updated_by_last_action end end - - describe "#action_uninstall" do - it "should call :remove with a deprecation warning" do - Chef::Config[:treat_deprecation_warnings_as_errors] = false - expect(Chef::Log).to receive(:deprecation).with(/please use :remove/) - allow_remote_list(["ConEmu"]) - new_resource.package_name("ConEmu") - provider.load_current_resource - expect(provider).to receive(:remove_package) - provider.run_action(:uninstall) - expect(new_resource).to be_updated_by_last_action - end - end end describe "behavior when Chocolatey is not installed" do -- cgit v1.2.1