[PATCH/smart-proxy 1/1] Fix: #1004 -- puppetca is depreciated in puppet 2.6+

Signed-off-by: Corey Osman <corey@logicminds.biz>

··· --- lib/proxy/puppetca.rb | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/lib/proxy/puppetca.rb b/lib/proxy/puppetca.rb
index b952ce6…4a8b017 100644
— a/lib/proxy/puppetca.rb
+++ b/lib/proxy/puppetca.rb
@@ -97,11 +97,20 @@ module Proxy::PuppetCA
raise "SSL/CA unavailable on this machine"
end

  •  @puppetca = which("puppetca", "/usr/sbin")
    
  •  # puppetca is the old method of using puppet cert
    
  •  @puppetca = which("puppetca", ["/usr/sbin","/opt/puppet/bin"])
     unless File.exists?("#{@puppetca}")
    
  •    # Puppet 2.6+ uses puppet cert instead of puppetca
    
  •    @puppetca = which("puppet", ["/usr/sbin","/opt/puppet/bin"])
    
  •  end
    
  •  unless File.exists?("#{@puppetca}") 
       logger.warn "unable to find puppetca binary"
       raise "unable to find puppetca"
     end
    
  •  # Append cert to the puppet command if we are not using the old puppetca command
    
  •  if not @puppetca.include? 'puppetca' 
    
  •    @puppetca << " cert"
    
  •  end
     logger.debug "Found puppetca at #{@puppetca}"
    
     @sudo = which("sudo", "/usr/bin")
    


1.7.4.1