diff options
author | Cole Robinson <crobinso@redhat.com> | 2014-03-20 13:45:52 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2014-03-20 14:04:29 -0400 |
commit | 1f5b07bea86b6bb5d126bae1b794cf00a9aec320 (patch) | |
tree | 75f11bcd54baf7800b49aa0abfe9057036b3540d /virtinst | |
parent | 994b1fa4f4fe7363fa0ef1aa456172bf4342bd73 (diff) | |
download | virt-manager-1f5b07bea86b6bb5d126bae1b794cf00a9aec320.tar.gz |
capabilities: Handle broken return value of failed CPUModelNames
Diffstat (limited to 'virtinst')
-rw-r--r-- | virtinst/capabilities.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/virtinst/capabilities.py b/virtinst/capabilities.py index 36ee431f..029bfdbf 100644 --- a/virtinst/capabilities.py +++ b/virtinst/capabilities.py @@ -86,11 +86,13 @@ class CPUValues(object): if self._cpus is not None: return self._cpus - if (conn and - conn.check_support(conn.SUPPORT_CONN_CPU_MODEL_NAMES)): - self._cpus = [CPUValuesModel(i) for i in - conn.getCPUModelNames(arch, 0)] - return self._cpus + if (conn and conn.check_support(conn.SUPPORT_CONN_CPU_MODEL_NAMES)): + names = conn.getCPUModelNames(arch, 0) + + # Bindings were broke for a long time, so catch -1 + if names != -1: + self._cpus = [CPUValuesModel(i) for i in names] + return self._cpus return [] |