throw PollsterPermenantError exception for memory usage meter

For memory usage meter, if it is not supported by libvirt and the
underlying hypervisor being used by libvirt, there is no meaning
to running the pollster again and again and so we should throw
PollsterPermenantError exception, like what l3 cache meter does.

Change-Id: I871841f2ce8f755bdeb2aff3fb063158b5c0650a
Closes-Bug: 1599344
This commit is contained in:
Qiaowei Ren
2016-07-06 10:44:37 +08:00
parent bb35821852
commit b8cc36b5ea
5 changed files with 34 additions and 4 deletions

View File

@@ -220,7 +220,7 @@ class LibvirtInspector(virt_inspector.Inspector):
'<name=%(name)s, id=%(id)s>, '
'can not get info from libvirt.') % {
'name': instance_name, 'id': instance.id}
raise virt_inspector.NoDataException(msg)
raise virt_inspector.InstanceNoDataException(msg)
# memoryStats might launch an exception if the method is not supported
# by the underlying hypervisor being used by libvirt.
except libvirt.libvirtError as e: