-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node['chocolatey']['upgrade'] attribute not working #12
Comments
Whilst testing a fix for this, it seems chocolatey errors during the upgrade, even if it is OK afterwards. This is a problem that I can only seem to resolve by ignoring some return codes, which is not ideal... |
I wonder if with the latest release [1] which mentions fixing retcode issues, if this is still a problem? |
I have the same issue with cookbook version 0.3.0. From what I could debug, this is because in providers/default.rb/package_exists? method, we execute This is because the Maybe the chocolatey cookbook should install the chocolatey package by default? |
I was hoping to use the node['chocolatey']['upgrade'] attribute to keep the underlying chocolatey version up to date, but it doesn't seem to work. I think this is due to how the LWRP behaves if the version field is left blank as it is in the chocolatey "chocolatey" resource at the end of the default recipe.
Looking at the code in providers/default.rb, which runs in response to that resource, "package_installed?" will be true as obviously chocolatey is already installed (by the install.ps1 boot-strapper). We don't specify a particular version, so "package_exists?" also returns true. Unfortunately "upgradeable?" takes the latter as gospel so assumes there's nothing to do.
Would you accept a PR to only use @current_resource.exists if the version is not blank?
The text was updated successfully, but these errors were encountered: