setup - fix processor facts for older SMBIOS versions #457
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
On hosts with older SMBIOS versions (pre 2.5) the core and thread count fields are not present and the current code was just reading the random bytes after this type structure. This caused the processor count to be returned as random values. Instead have a fallback to the slower CIM/WMI method for older hosts.
The
ansible_processor_threads_per_core
was also being set to the number of threads per processor/CPU and not per core. This fixes the logic to return the correct value as it has been in the past.It will also ignore any processor entries that are not populated and are not set as enabled.
Finally this also takes into account the
Core Count 2
andThread Count 2
fields on the SMBIOS processor information if present. This is a new field added by SMBIOS 3.0 to be able to return core counts greater than 256.ISSUE TYPE
COMPONENT NAME
setup