1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix cpu facts for hosts missing fields in cpuinfo (16533) (#16535)

Change linux fact gathering to correctly gather ansible_processor_count
and ansible_processor_vcpus on systems without vendor_id/model_name in
/proc/cpuinfo (for ex, ppc64/POWER)
This commit is contained in:
Adam Reznechek 2016-09-13 16:19:33 -05:00 committed by Adrian Likins
parent b510abce17
commit 23930d799f

View file

@ -1121,8 +1121,10 @@ class LinuxHardware(Hardware):
elif key == '# processors': elif key == '# processors':
self.facts['processor_cores'] = int(data[1].strip()) self.facts['processor_cores'] = int(data[1].strip())
if vendor_id_occurrence == model_name_occurrence: # Skip for platforms without vendor_id/model_name in cpuinfo (e.g ppc64le)
i = vendor_id_occurrence if vendor_id_occurrence > 0:
if vendor_id_occurrence == model_name_occurrence:
i = vendor_id_occurrence
if self.facts['architecture'] != 's390x': if self.facts['architecture'] != 's390x':
if xen_paravirt: if xen_paravirt: