diff options
author | Thom May <thom@may.lt> | 2018-03-01 12:04:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-01 12:04:37 +0000 |
commit | f1f42964f96abb436dcece434f796e0bf9ca1a66 (patch) | |
tree | b9b37464175da0985a305a654653544c3a4af55f | |
parent | d857de24b4caab0b8b57e7e4460da7155af261a7 (diff) | |
parent | 494de6eea80595bd44d98fac6cd2560d1a5731cc (diff) | |
download | chef-f1f42964f96abb436dcece434f796e0bf9ca1a66.tar.gz |
Merge pull request #6920 from chef/remove_choco_uninstall
Remove the :uninstall action from chocolatey_package - CHEF-21
-rw-r--r-- | lib/chef/provider/package/chocolatey.rb | 8 | ||||
-rw-r--r-- | lib/chef/resource/chocolatey_package.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/package/chocolatey_spec.rb | 13 |
3 files changed, 1 insertions, 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 |