Make pip3_cmd a class method.

* modules/pip/lib/puppet/provider/package/pip3.rb(pip3_cmd): The
instances class method was attempting to call the pip3_cmd instance
method, which does not work. Instead define a self.pip3_cmd method
it can call and then delegate the pip3_cmd instance method to that.
Also corrects an error message typo in passing.

Change-Id: I8a7b7ce353ac4293c2d7b82999402fa47dde6051
Reviewed-on: https://review.openstack.org/35708
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This commit is contained in:
Jeremy Stanley 2013-07-04 20:14:07 +00:00 committed by Jenkins
parent 7eaa598916
commit 5e7c0d558d
1 changed files with 6 additions and 2 deletions

View File

@ -124,11 +124,15 @@ Puppet::Type.type(:package).provide :pip3,
pip *args
end
def pip3_cmd
def self.pip3_cmd
['/usr/bin/python3-pip', '/usr/bin/pip3', '/usr/bin/pip-3.2', '/usr/bin/pip-3.3'].each do |p|
return p if File.exist?(p)
end
raise Puppet::Error, "Unable to fine pip3 binary.";
raise Puppet::Error, "Unable to find pip3 binary.";
end
def pip3_cmd
return self.class.pip3_cmd
end
end