Facter.add(:thrift_path) do
  confine :kernel => :linux
  setcode do
    path = which('thrift')
    if path
      path.to_s
    else
      nil
    end
  end
  def which(cmd)
    exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
    ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
      exts.each { |ext|
        exe = File.join(path, "#{cmd}#{ext}")
        return exe if File.executable?(exe) && !File.directory?(exe)
      }
    end
    return nil
  end
end

Add fact to find the install of thrift
Add fact to find the install of thrift
