<commit_before>require 'set'

if Facter.value(:kernel) == "Linux"
  Facter.add("raid") do
    confine :kernel => :linux
    setcode do
      raid_list = Set.new()

      mdstat_output = `cat /proc/mdstat 2>/dev/null`
      if $?.success?
        mdstat_output.each_line do |l|
          if l =~ /^md.*: .*raid/
            raid_list << 'linux-md'
            break
          end
        end
      end

      lspci_adaptec_output = `lspci -d 9005: 2>/dev/null`
      if $?.success?
        raid_list << 'adaptec' if lspci_adaptec_output
      end

      lspci_lsi_output = `lspci -d 1000: 2>/dev/null`
      if $?.success?
        lspci_lsi_output.each_line do |l|
          raid_list << "lsi-mpt-fusion-u320" if l.include?("Fusion-MPT Dual Ultra320")
          raid_list << "lsi-megaraid" if l.include?("MegaRAID")
          raid_list << "lsi-megaraidsas" if l.include?("MegaRAID SAS") || l.include?("SAS1078 PCI-X Fusion-MPT SAS") || l.include?("LSI MegaSAS")
        end
      end

      raid_list.to_a.join(',')
    end
  end
end<commit_msg>Raid fact: need to grep lspci, ignore not-implemented controllers<commit_after>require 'set'

if Facter.value(:kernel) == "Linux"
  Facter.add("raid") do
    confine :kernel => :linux
    setcode do
      raid_list = Set.new()

      mdstat_output = `cat /proc/mdstat 2>/dev/null`
      if $?.success?
        mdstat_output.each_line do |l|
          if l =~ /^md.*: .*raid/
            raid_list << 'linux-md'
            break
          end
        end
      end

      lspci_adaptec_output = `lspci -d 9005: 2>/dev/null | grep 'RAID'`
      if $?.success?
        raid_list << 'adaptec' if lspci_adaptec_output
      end

      lspci_lsi_output = `lspci -d 1000: 2>/dev/null | grep 'RAID'`
      if $?.success?
        lspci_lsi_output.each_line do |l|
          #raid_list << "lsi-mpt-fusion-u320" if l.include?("Fusion-MPT Dual Ultra320")
          #raid_list << "lsi-megaraid" if l.include?("MegaRAID")
          raid_list << "lsi-megaraidsas" if l.include?("MegaRAID SAS") || l.include?("SAS1078 PCI-X Fusion-MPT SAS") || l.include?("LSI MegaSAS")
        end
      end

      raid_list.to_a.join(',')
    end
  end
end
{'fraction_non_alphanumeric': 0.14147465437788018, 'fraction_numerical': 0.01935483870967742, 'mean_word_length': 2.1739766081871346, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7534391', 'n_tokens_mistral': 883, 'n_tokens_neox': 804, 'n_words': 175}