lib/ohai/plugins/kernel.rb in ohai-16.6.5 vs lib/ohai/plugins/kernel.rb in ohai-16.7.18

- old
+ new

@@ -1,5 +1,6 @@ +# frozen_string_literal: true # # Author:: Adam Jacob (<adam@chef.io>) # Author:: Benjamin Black (<nostromo@gmail.com>) # Author:: Bryan McLellan (<btm@loftninjas.org>) # Author:: Claire McQuin (<claire@chef.io>) @@ -242,10 +243,10 @@ so = shell_out("modinfo") # EXAMPLE: # Id Loadaddr Size Info Rev Module Name # 6 1180000 4623 1 1 specfs (filesystem for specfs) - module_description = /[\s]*([\d]+)[\s]+([a-f\d]+)[\s]+([a-f\d]+)[\s]+(?:[\-\d]+)[\s]+(?:[\d]+)[\s]+([\S]+)[\s]+\((.+)\)$/ + module_description = /\s*(\d+)\s+([a-f\d]+)\s+([a-f\d]+)\s+(?:[\-\d]+)\s+(?:\d+)\s+(\S+)\s+\((.+)\)$/ so.stdout.lines do |line| if ( mod = module_description.match(line) ) modules[mod[4]] = { id: mod[1].to_i, loadaddr: mod[2], size: mod[3].to_i(16), description: mod[5] } end end