From b1c9b0f7999ccb4f4fbde139fa0b79a974a6e851 Mon Sep 17 00:00:00 2001 From: Artem Vasilyev Date: Tue, 28 Jan 2020 10:02:47 +0300 Subject: [PATCH] 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 --- ceilometer/compute/discovery.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ceilometer/compute/discovery.py b/ceilometer/compute/discovery.py index 38a585c9fd..b59550a06f 100644 --- a/ceilometer/compute/discovery.py +++ b/ceilometer/compute/discovery.py @@ -24,7 +24,6 @@ from oslo_config import cfg from oslo_log import log from oslo_utils import timeutils - try: import libvirt except ImportError: @@ -147,7 +146,7 @@ class InstanceDiscovery(plugin_base.DiscoveryBase): raise LOG.error( "Fail to get domain uuid %s metadata, libvirtError: %s", - domain.UUIDString(), e.message) + domain.UUIDString(), e) continue full_xml = etree.fromstring(domain.XMLDesc())