Fix logging libvirt error on python 3
This patch fixes error caused by absence of "message" attribute in libvirtError when running on python 3. ceilometer-agent-compute service fails to fetch domain metadata and tries to log libvirt error, during logging the following exception is raised and service fails: AttributeError: 'libvirtError' object has no attribute 'message' Change-Id: I56e74d1cb30310db104c850e74b2d422d3aeb966
This commit is contained in:
parent
1ae5dcbb32
commit
c8fd9fdd97
|
@ -24,7 +24,6 @@ from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import libvirt
|
import libvirt
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -147,7 +146,7 @@ class InstanceDiscovery(plugin_base.DiscoveryBase):
|
||||||
raise
|
raise
|
||||||
LOG.error(
|
LOG.error(
|
||||||
"Fail to get domain uuid %s metadata, libvirtError: %s",
|
"Fail to get domain uuid %s metadata, libvirtError: %s",
|
||||||
domain.UUIDString(), e.message)
|
domain.UUIDString(), e)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
full_xml = etree.fromstring(domain.XMLDesc())
|
full_xml = etree.fromstring(domain.XMLDesc())
|
||||||
|
|
Loading…
Reference in New Issue