Skip to content

node['chocolatey']['upgrade'] attribute not working #12

@tyrken

Description

@tyrken

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions