Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.21 KB

deprecations_chocolatey_uninstall.md

File metadata and controls

41 lines (32 loc) · 1.21 KB

+++ title = "Deprecation: :uninstall Resource for chocolatey_package (CHEF-21)" draft = false

gh_repo = "chef-web-docs" robots = "noindex" sitemapExclude = true aliases = "/deprecations_chocolatey_uninstall.html"

+++

The Chocolatey cookbook's chocolatey_package resource originally contained an :uninstall action. When chocolatey_package was moved into core Chef, we made :uninstall an alias for :remove. In Chef Infra Client 14, :uninstall will no longer be a valid action.

The Cookstyle cop ChefDeprecations/ChocolateyPackageUninstallAction has been introduced to detect and autocorrect this deprecation.

Remediation

The :uninstall action must be replaced with the :remove action when using the chocolatey_package resource in recipes that you intend to use with Chef Infra Client 14. For example, where you might previously have used the following code to uninstall nginx:

chocolatey_package 'nginx' do
  action :uninstall
end

You would instead use:

chocolatey_package 'nginx' do
  action :remove
end