…ta API Supported API's are determined at instance launch and are not extended over the life of the instance. As such the current code - which makes an assumption of a specific version - will fail depending on the age of the instance. This new code probes the instance metadata endpoint for available versions, determines the most advanced version known to work and executes the metadata retrieval using that version. If no compatible version is found, the plugin returns an empty hash.
…/etc/release format over the last year.
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']["_items"]["serial_number"] will return the serial number. Changing this to: node['system_profile'][SPHardwareDataType"]["serial_number"] would be preferable but break compatibility.