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

(MODULES-3677) Ensure Chocolatey Config #37

Conversation

ferventcoder
Copy link

When Chocolatey has been installed and not yet run, the config file
doesn't exist. So chocolateyconfig, chocolateyfeature, and
chocolateysource will all fail until the config file exists.

Trigger a version check before returning the config file in
PuppetX::Chocolatey::ChocolateyCommon.choco_config_file. This
will ensure that an installed Chocolatey will have had the chance
to run at least one time if it is installed, thus ensuring the
config file's existence, allowing the providers to work without
erroring on a missing config file.

When Chocolatey has been installed and not yet run, the config file
doesn't exist. So chocolateyconfig, chocolateyfeature, and
chocolateysource will all fail until the config file exists.

Trigger a version check before returning the config file in
`PuppetX::Chocolatey::ChocolateyCommon.choco_config_file`. This
will ensure that an installed Chocolatey will have had the chance
to run at least one time if it is installed, thus ensuring the
config file's existence, allowing the providers to work without
erroring on a missing config file.
@@ -62,6 +62,10 @@ def choco_config_file
chocoInstallPath = PuppetX::Chocolatey::ChocolateyInstall.install_path
choco_config = "#{chocoInstallPath}\\config\\chocolatey.config"

# choco may be installed, but a config file doesn't exist until the
# first run of choco - trigger that by checking the version
choco_run_ensure_config = choco_version

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to add an additional file existance check above as well? That way we don't run a choco.exe IF the config file exists

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We typically call choco -v during the run and then store the results for the remainder of the run, this just moves that call up earlier.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh ok

@glennsarti
Copy link

Created MODULES-3691 to create acceptance test for this change.

@glennsarti glennsarti merged commit c6424fe into puppetlabs:master Aug 5, 2016
@ferventcoder ferventcoder deleted the ticket/master/MODULES-3677-ensure_config branch August 6, 2016 20:09
ThoughtCrhyme pushed a commit to ThoughtCrhyme/puppetlabs-chocolatey that referenced this pull request Mar 20, 2017
Updated vmfloaty module to allow different home dirs
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.

3 participants