diff --git a/lib/ohai/plugins/linux/lspci.rb b/lib/ohai/plugins/linux/lspci.rb index f75a0f865..5cfe39db0 100644 --- a/lib/ohai/plugins/linux/lspci.rb +++ b/lib/ohai/plugins/linux/lspci.rb @@ -51,10 +51,14 @@ def standard_array(devices, d_id, tag, line) case dev[0] when "Device" # There are two different Device tags - if ( tmp = dev[1].match(/(#{hh}:#{hh}.#{h})/) ) + if ( tmp = dev[1].match(/(#{hhhh}:)?(#{hh}:#{hh}\.#{h})/) ) # We have a device id d_id = tmp[0] # From now on we will need this id devices[d_id] = Mash.new + if tmp[1] + # We have a root complex + devices[d_id]['root_port'] = tmp[1][0..-2] + end else standard_form(devices, d_id, hhhh, "device", dev[1]) end