Bug #11958

obscure error message from pip package provider when python-pip is not installed

Added by Ahmed El Gamil over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:01/14/2012
Priority:NormalDue date:01/17/2012
Assignee:Kelsey Hightower% Done:

100%

Category:provider
Target version:2.7.10
Affected Puppet version:2.7.6 Branch:https://github.com/puppetlabs/puppet/pull/337
Keywords:error usability ux

Description

Hi,

Puppet generates an obscure error when the pip command is not installed or not in PATH.

Error is like : [default] err: /Stage[main]/Uwsgi/Package[uwsgi]/ensure: change from absent to latest failed: Could not update: undefined method `pip' for #<Puppet::Type::Package::ProviderPip:0xb72b8998> at /tmp/vagrant-puppet/manifests/nodes-vagrant.pp:17

A more informative error message should be displayed, or even stopping the puppet run.

Thanks

History

#1 Updated by Nigel Kersten over 1 year ago

  • Keywords set to error usability ux

#2 Updated by Kelsey Hightower over 1 year ago

  • Status changed from Unreviewed to Accepted
  • Assignee set to Kelsey Hightower

Taking a look at this now.

#3 Updated by Kelsey Hightower over 1 year ago

  • Branch set to https://github.com/kelseyhightower/puppet/tree/ticket/2.7.x/11958_pip_provider_better_error_messages

#4 Updated by Kelsey Hightower over 1 year ago

  • Due date set to 01/17/2012
  • Status changed from Accepted to In Topic Branch Pending Review
  • Target version set to 2.7.x
  • % Done changed from 0 to 100
  • Branch changed from https://github.com/kelseyhightower/puppet/tree/ticket/2.7.x/11958_pip_provider_better_error_messages to https://github.com/puppetlabs/puppet/pull/337

Pending review

Changes are ready for review – Pull Request: 337

#5 Updated by Daniel Pittman over 1 year ago

I get a failure in the package acceptance tests in the suite:

  1) Package provider pip should fail when asked to install an invalid package
     Failure/Error: lambda { pkg.provider.install }.should raise_error
       expected Exception but nothing was raised
     # ./spec/integration/provider/package_spec.rb:22

#6 Updated by Daniel Pittman over 1 year ago

  • Status changed from In Topic Branch Pending Review to Tests Insufficient

#7 Updated by Kelsey Hightower over 1 year ago

  • Status changed from Tests Insufficient to In Topic Branch Pending Review

Ok, I have updated my branch and all tests should be passing now:

$ rspec spec/integration/provider/package_spec.rb
........*.
Pending:
Package provider gem should fail when asked to install an invalid package
# This test hangs forever with recent versions of RubyGems
# ./spec/integration/provider/package_spec.rb:11
Finished in 0.77979 seconds
10 examples, 0 failures, 1 pending

[kelseyhightower@~/Workspace/puppet]$ rspec spec/unit/provider/package/pip_spec.rb 
...................
Finished in 0.53722 seconds
19 examples, 0 failures

Also, I have updated the error message to look like this:

err: /Stage[main]/Dummy/Package[virtualenv]/ensure: change from absent to present failed: Could not set 'present on ensure: Could not locate the pip command. at /etc/puppet/modules/dummy/manifests/init.pp:5

I am thinking “Could not locate the pip command” would be a bit more helpful.

#8 Updated by Kelsey Hightower over 1 year ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release

#9 Updated by Daniel Pittman over 1 year ago

  • Target version changed from 2.7.x to 2.7.10

#10 Updated by Michael Stahnke over 1 year ago

  • Status changed from Merged - Pending Release to Closed

released in 2.7.10rc1

Also available in: Atom PDF