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

Replace chocolatey::params with hiera data #272

Merged
merged 2 commits into from
Feb 16, 2022

Conversation

smortex
Copy link
Collaborator

@smortex smortex commented Jan 13, 2022

The chocolatey::params class in an internal detail with low value for end-users but cannot be made private for technical reasons so appears in end-users documentation. It is only useful to provide a default value to $chocolatey::choco_install_location when the fact choco_install_path is not defined, which can be achieved using hiera.

@smortex smortex requested a review from a team as a code owner January 13, 2022 23:33
@smortex smortex changed the title hiera Drop the legacy chocolatey::params class Jan 13, 2022
bastelfreak
bastelfreak previously approved these changes Jan 14, 2022
@smortex

This comment was marked as off-topic.

@smortex smortex changed the title Drop the legacy chocolatey::params class Replace chocolatey::params with hiera data Feb 16, 2022
@smortex
Copy link
Collaborator Author

smortex commented Feb 16, 2022

Updated this PR to squash the commits.

The chocolatey::params class in an internal detail with low value for
end users but cannot be made private for technical reasons so appears in
end-users documentation.  It is only useful to provide a default value
to $chocolatey::choco_install_location when the fact choco_install_path
is not defined, which can be achieved using hiera.
This is fine when the CI is exercised in GitHub Action environment but
fails on my local machine with some reference to my user local facts
overrides:

```
Failures:

  1) Puppet::Type::Package::ProviderChocolatey self.read_choco_features when getting sources from the config file matches the count of sources in the config
     Failure/Error: ENV['ChocolateyInstall'] = Facter.value('choco_install_path') || PuppetX::Chocolatey::ChocolateyInstall.install_path

       #<File (class)> received :read with unexpected arguments
         expected: ("c:\\choco.config")
              got: ("/home/romain/.puppetlabs/opt/facter/facts.d/customer.yaml")
     # ./lib/puppet_x/chocolatey/chocolatey_common.rb:56:in `set_env_chocolateyinstall'
     # ./lib/puppet/provider/package/chocolatey.rb:63:in `read_choco_features'
     # ./spec/unit/puppet/provider/package/chocolatey_spec.rb:164:in `block (4 levels) in <top (required)>'

  2) Puppet::Type::Package::ProviderChocolatey self.read_choco_features when getting sources from the config file contains xml elements
     Failure/Error: ENV['ChocolateyInstall'] = Facter.value('choco_install_path') || PuppetX::Chocolatey::ChocolateyInstall.install_path

       #<File (class)> received :read with unexpected arguments
         expected: ("c:\\choco.config")
              got: ("/home/romain/.puppetlabs/opt/facter/facts.d/customer.yaml")
     # ./lib/puppet_x/chocolatey/chocolatey_common.rb:56:in `set_env_chocolateyinstall'
     # ./lib/puppet/provider/package/chocolatey.rb:63:in `read_choco_features'
     # ./spec/unit/puppet/provider/package/chocolatey_spec.rb:173:in `block (4 levels) in <top (required)>'
```

Stub set_env_chocolateyinstall like done is the other tests to fix the
issue.
@bastelfreak bastelfreak merged commit f47993a into puppetlabs:main Feb 16, 2022
@smortex smortex deleted the hiera branch February 16, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants