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

make sure that puppet sets setExplicitly when disabled #361

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

brajjan
Copy link

@brajjan brajjan commented Sep 20, 2024

Summary

Fixes issue #360

When changing a chocolateyfeature to enabled it only sets the "enabled" property to "true" (this is how chocolatey defines its default values) and does not care about the "setExplicitly" property.

eg.

chocolateyfeature { 'exitOnRebootDetected':
  ensure => 'enabled',
}

Notice: /Stage[main]/Main/Chocolateyfeature[exitOnRebootDetected]/ensure: ensure changed 'disabled' to 'enabled'

PS> Get-Content C:\ProgramData\chocolatey\config\chocolatey.config | Select-String exitOnRebootDetected

<feature name="exitOnRebootDetected" enabled="true" setExplicitly="false" description="Exit On Reboot Detected - Stop running install, upgrade, or uninstall when a reboot request is detected. Requires 'usePackageExitCodes' feature to be turned on. Will exit with either 350 or 1604. When it exits with 350, it
means pending reboot discovered prior to running operation. When it exits with 1604, it means some work completed prior to reboot request being detected." />

This change also sets the setExplicitly="true" when adding a chocolateyfeature.
If the feature is disabled the enabled property will change to disabled and the setExplicitly will remain true

Additional Context

Add any additional context about the problem here.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

Related Issues (if any)

Fixes issue #360

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@brajjan brajjan requested a review from a team as a code owner September 20, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant