opscode/ohai — pull request #107 by paulmooring (2012-11-27 23:21:46+00:00)
Title: Added serial_number to system_profile per OHAI-395.  The current code is

a little ugly, it sets the attribute to an array and uses the 'mini'
detailLevel. I defined a hash to choose the detail level per dataType,
iterate through an array for each detail level (this is to only shell
out once per detail level rather than each dataType) and finally sort
the array to make sure it's in the same order as before my changes
compatibility.

The result is this is compatible with the old structure and:
node['system_profile'][10]["_items"][0]["serial_number"]
will return the serial number. Changing this to:
node['system_profile'][SPHardwareDataType"]["serial_number"]
would be preferable but break compatibility.