HomePhorge

(#11958) Improve error msg for missing pip command
2d4af0e649d4Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#11958) Improve error msg for missing pip command

Without this patch the pip package provider does not produce a user
friendly error message when the pip command is not available. The
current error message looks like this:

err: /Stage[main]/Dummy/Package[virtualenv]/ensure: change from
absent to present failed: Could not set 'present on ensure:
undefined method `pip' for
#<Puppet::Type::Package::ProviderPip:0xb6cf6cd0> at
/etc/puppet/modules/dummy/manifests/init.pp:5

This patch improves the error message by passing a string argument, 'Could not locate
the pip command.', when raising the NoMethodError. The new error
message looks 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

This patch also includes updated spec tests validating this change. No
other behavior changes are being introduced.

Details

Event Timeline

Kelsey Hightower <kelsey@puppetlabs.com> committed rPU2d4af0e649d4: (#11958) Improve error msg for missing pip command (authored by Kelsey Hightower <kelsey@puppetlabs.com>).Jan 17 2012, 9:20 PM