commit 98b43aad172c894d3c4e288e40eaa3c4f822d47f
Author: ZhiQiang Fan <email address hidden>
Date: Mon Nov 17 23:14:03 2014 +0800
Return a meaningful value or raise an excpetion for libvirt
Currently, there are some cases libvirt cannot inspect instance's memory
usage, and it is a normal behavior so libvirt just logs messages and
returns None. However, memory pollster doesn't check return value, so
AttributeError will be raised in such case, which leading to unnecessary
exception log messages in every cycle and for each instance, this will
bother cloud operator.
This patch uses virt.inspector exceptions for libvirt, so when there is no
valid value can be returned, we raise an exception, pollsters can catch
those exceptions and log proper messages. Since all of them are non-fatal
exception, log level is set to warn, which is excatly same as previous.
Note, this patch refactors some code of libvirt to suit this change.
Reviewed: https:/ /review. openstack. org/134966 /git.openstack. org/cgit/ openstack/ ceilometer/ commit/ ?id=98b43aad172 c894d3c4e288e40 eaa3c4f822d47f
Committed: https:/
Submitter: Jenkins
Branch: master
commit 98b43aad172c894 d3c4e288e40eaa3 c4f822d47f
Author: ZhiQiang Fan <email address hidden>
Date: Mon Nov 17 23:14:03 2014 +0800
Return a meaningful value or raise an excpetion for libvirt
Currently, there are some cases libvirt cannot inspect instance's memory
usage, and it is a normal behavior so libvirt just logs messages and
returns None. However, memory pollster doesn't check return value, so
AttributeError will be raised in such case, which leading to unnecessary
exception log messages in every cycle and for each instance, this will
bother cloud operator.
This patch uses virt.inspector exceptions for libvirt, so when there is no
valid value can be returned, we raise an exception, pollsters can catch
those exceptions and log proper messages. Since all of them are non-fatal
exception, log level is set to warn, which is excatly same as previous.
Note, this patch refactors some code of libvirt to suit this change.
Change-Id: I2c94aab90e827c 75a602403d3c64f d6f67f73007
Closes-Bug: #1393415