ohai
ohai copied to clipboard
Fall back to /proc/cpuinfo if lscpu doesn't have CPU totals
Description
https://github.com/chef/ohai/pull/1454 made lscpu the primary way Ohai gathers CPU data, but the parser doesn't handle the output from a Raspberry Pi 4 Cortex-A72. For example, an ARM cluster has the output Core(s) per cluster instead of Core(s) per socket.
We should fall back to /proc/cpuinfo if we don't get reasonable data back. It's not enough just to have lscpu output.
Related Issue
- https://github.com/chef/ohai/issues/1760
- https://github.com/chef/ohai/issues/1755
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Chore (non-breaking change that does not add functionality or fix an issue)
Checklist:
- [x] I have read the CONTRIBUTING document.
- [x] I have run the pre-merge tests locally and they pass.
- [x] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [ ] All commits have been signed-off for the Developer Certificate of Origin.
Ping @stanhu
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
@jaymzh Done, thanks.