From daa44086195954ae8744c30498ec999c9a1478ed Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 4 Jul 2013 20:14:07 +0000 Subject: [PATCH] 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 Approved: Clark Boylan Reviewed-by: Clark Boylan Tested-by: Jenkins --- modules/pip/lib/puppet/provider/package/pip3.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/pip/lib/puppet/provider/package/pip3.rb b/modules/pip/lib/puppet/provider/package/pip3.rb index 5afb615c1d..f155a572ec 100644 --- a/modules/pip/lib/puppet/provider/package/pip3.rb +++ b/modules/pip/lib/puppet/provider/package/pip3.rb @@ -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