summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Berendt <berendt@b1-systems.de>2012-11-08 20:41:07 +0100
committerChristian Berendt <berendt@b1-systems.de>2012-11-08 20:49:17 +0100
commit0406d1f85fa93db4e4d5ab8b37d298951d4c4193 (patch)
tree4e56fa898d2ed77750738d54c642b8d96ba02358
parentfab607c72c36ace398cee817bae2525162dcb9f1 (diff)
downloadnova-0406d1f85fa93db4e4d5ab8b37d298951d4c4193.tar.gz
nova-0406d1f85fa93db4e4d5ab8b37d298951d4c4193.tar.xz
nova-0406d1f85fa93db4e4d5ab8b37d298951d4c4193.zip
make diagnostics workable for libvirt with Xen
When using "diagnostics" with libvirt as driver on nova-compute and Xen as hypervisor the call to domain.memoryStats() in get_diagnostics() doesn't fail with a libvirt.libvirtError, but with an AttributeError. This exception should be catched, too. The method virDomainMemoryStats is not implemented in libvirt for Xen. fixes bug 1076527 Change-Id: I16645654b346e3c40ff3dd63f20600c802cbeb3f
-rw-r--r--nova/virt/libvirt/driver.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index c59876d95..7f962b45d 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -2986,7 +2986,7 @@ class LibvirtDriver(driver.ComputeDriver):
mem = domain.memoryStats()
for key in mem.keys():
output["memory-" + key] = mem[key]
- except libvirt.libvirtError:
+ except (libvirt.libvirtError, AttributeError):
pass
return output