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

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/deprecations_chocolatey_uninstall/