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-4056) Helpful Error if No Sources Enabled #57

Conversation

ferventcoder
Copy link

Previously, when there were no sources enabled, Puppet would
attempt to loop over a non-existent set of packages pulled back
from listing a set of packages locally. Unfortunately this is due
to an issue in Chocolatey that requires at least one source to be
enabled to produce the local set of installed packages:
chocolatey/choco#661

Instead of allowing Puppet to fail on a nil:NilClass error, provide
a helpful and actionable message instead.

@@ -473,6 +473,14 @@
:name => 'package2'
}
end

it "should return nil on error" do
provider.expects(:execpipe).yields(StringIO.new(%Q(Unable to search for packages when there are not soures enabled for packages and none were passed as arguments.\n)))
Copy link

Choose a reason for hiding this comment

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

Nitpick: no sources instead of not sources

Copy link
Author

Choose a reason for hiding this comment

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

Ah yes. Typo adding command. Will fix.

Copy link
Author

Choose a reason for hiding this comment

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

Done

Previously, when there were no sources enabled, Puppet would
attempt to loop over a non-existent set of packages pulled back
from listing a set of packages locally. Unfortunately this is due
to an issue in Chocolatey that requires at least one source to be
enabled to produce the local set of installed packages:
chocolatey/choco#661

Instead of allowing Puppet to fail on a nil:NilClass error, provide
a helpful and actionable message instead.
@ferventcoder ferventcoder force-pushed the ticket/master/MODULES-4056-no_sources_error branch from 29cdf02 to 3647114 Compare December 14, 2016 15:26
@jpogran jpogran merged commit ff9c1c6 into puppetlabs:master Dec 14, 2016
@ferventcoder ferventcoder deleted the ticket/master/MODULES-4056-no_sources_error branch December 14, 2016 15:34
ThoughtCrhyme pushed a commit to ThoughtCrhyme/puppetlabs-chocolatey that referenced this pull request Mar 20, 2017
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