Skip to main content

Deprecation: :uninstall Resource for chocolatey_package (CHEF-21)

[edit on GitHub]

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 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 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

Was this page helpful?









Search Results