diff --git a/automation/check-patch.packages b/automation/check-patch.packages index 466c21ae..1d51947b 100644 --- a/automation/check-patch.packages +++ b/automation/check-patch.packages @@ -2,6 +2,7 @@ ansible bats dnf dnf-command(builddep) +gcc git grubby libffi-devel diff --git a/lago/providers/libvirt/cpu.py b/lago/providers/libvirt/cpu.py index 0674e5bc..5d660566 100644 --- a/lago/providers/libvirt/cpu.py +++ b/lago/providers/libvirt/cpu.py @@ -19,6 +19,7 @@ # import logging +import libvirt from lxml import etree as ET @@ -392,6 +393,18 @@ def get_cpu_props(cls, family, arch='x86'): @classmethod def get_cpus_by_arch(cls, arch): + conn = libvirt.open('qemu:///system') + if conn is None: + raise LagoException('Failed to open connection to qemu:///system') + models = conn.getCPUModelNames('x86_64') + conn.close() + if models: + return models[0] + else: + raise LagoException('No such arch: {0}'.format(arch)) + + @classmethod + def get_cpus_by_arch1(cls, arch): """ Get all CPUs info by arch