Skip to content
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

(GH-283) Fix deprecation error #286

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

chelnak
Copy link

@chelnak chelnak commented Apr 7, 2022

Context

Fixes #283

In situations where the resource described in the manifest includes a version in its ensure property and choco v1 or above is installed, puppet runs would fail. This was happening of an issue where the version of chocolatey was not being properly derived by choco_version.

In turn, would cause compiled_choco to return false causing the module to default to using choco update rather than choco upgrade.

What has changed?

This PR fixes that by ensuring that the choco_version method returns the correct puppet version.

We can now observe the correct behaviour, even when the chocolateyversion fact has not been populated.

Debug: Facter: resolving fact with user_query: chocolateyversion
Debug: Facter: Searching fact: chocolateyversion in file: chocolateyversion.rb
Debug: Facter: List of resolvable facts: [#<Facter::SearchedFact:0x000001f3c8dae6a8 @name="chocolateyversion", @fact_class=nil, @user_query="chocolateyversion", @type=:custom, @file=nil>]
Debug: Facter: Searching fact: chocolateyversion in core facts and external facts
Debug: Facter: Loading all internal facts
Debug: Facter: Loading external facts
Debug: Facter: fact "chocolateyversion" has resolved to: 0
Debug: Executing: 'C:\ProgramData\chocolatey\choco.exe upgrade pwsh --version 7.2.2 -y  --ignore-package-exit-codes --no-progress'

@chelnak chelnak added the bugfix label Apr 7, 2022
@chelnak chelnak requested a review from a team as a code owner April 7, 2022 14:43
@chelnak chelnak force-pushed the GH-283-choco_update_is_deprecated branch 2 times, most recently from 4083d49 to 1ce86e9 Compare April 8, 2022 08:22
In situations where the resource described in the manifest includes a
version in its ensure property and choco v1 or above is installed,
puppet runs would fail. This was happening of an issue where the
version of chocolatey was not being properly derived by choco_version.

In turn, would cause compiled_choco to return false causing the
module to default to using choco update rather than choco upgrade.

This commit fixes that by ensuring that the choco_version method
returns the correct puppet version.
@chelnak chelnak force-pushed the GH-283-choco_update_is_deprecated branch from 74d4cd9 to 1a83f70 Compare April 8, 2022 08:58
@david22swan david22swan merged commit 5ce30f9 into main Apr 8, 2022
@david22swan david22swan deleted the GH-283-choco_update_is_deprecated branch April 8, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

choco update is deprecated
2 participants