(#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.