Browse files

Fixed bug in how single-disk machines were handled (in the case of a …

…single-disk machine, the Microkernel wasn't returning any disk information in the form of a "flattened array of disk information", because there was no flattened array of disk information hash values to return information from (just a single hash)
  • Loading branch information...
Tom McSweeney
Tom McSweeney committed Apr 21, 2012
1 parent 6e1df60 commit 2c7d9a3903883fbd74fab608f53ea58483ca64d6
Showing with 8 additions and 2 deletions.
  1. +8 −2 razor_microkernel/rz_mk_hardware_facter.rb
@@ -78,8 +78,14 @@ def add_facts_to_map!(facts_map, mk_fct_excl_pattern)
fields_to_include = ["description", "product", "physical_id", "bus_info",
"logical_name", "version", "serial", "size",
add_flattened_array_to_facts!(hash_map["disk_array"], facts_map,
"mk_hw_disk", fields_to_include)
disk_array = nil
if hash_map["disk_array"]
disk_array = hash_map["disk_array"]
elsif hash_map["disk"]
disk_array = []
disk_array << hash_map["disk"]
add_flattened_array_to_facts!(disk_array, facts_map, "mk_hw_disk", fields_to_include) if disk_array
# next, the processor information
lshw_c_processor_str = %x[sudo lshw -c processor]

0 comments on commit 2c7d9a3

Please sign in to comment.