Merge "do not translate debug logs"
This commit is contained in:
@@ -30,10 +30,10 @@ class CPUPollster(pollsters.BaseComputePollster):
|
||||
|
||||
def get_samples(self, manager, cache, resources):
|
||||
for instance in resources:
|
||||
LOG.debug(_('checking instance %s'), instance.id)
|
||||
LOG.debug('checking instance %s', instance.id)
|
||||
try:
|
||||
cpu_info = self.inspector.inspect_cpus(instance)
|
||||
LOG.debug(_("CPUTIME USAGE: %(instance)s %(time)d"),
|
||||
LOG.debug("CPUTIME USAGE: %(instance)s %(time)d",
|
||||
{'instance': instance.__dict__,
|
||||
'time': cpu_info.time})
|
||||
cpu_num = {'cpu_number': cpu_info.number}
|
||||
@@ -47,11 +47,11 @@ class CPUPollster(pollsters.BaseComputePollster):
|
||||
)
|
||||
except virt_inspector.InstanceNotFoundException as err:
|
||||
# Instance was deleted while getting samples. Ignore it.
|
||||
LOG.debug(_('Exception while getting samples %s'), err)
|
||||
LOG.debug('Exception while getting samples %s', err)
|
||||
except ceilometer.NotImplementedError:
|
||||
# Selected inspector does not implement this pollster.
|
||||
LOG.debug(_('Obtaining CPU time is not implemented for %s'
|
||||
), self.inspector.__class__.__name__)
|
||||
LOG.debug('Obtaining CPU time is not implemented for %s',
|
||||
self.inspector.__class__.__name__)
|
||||
except Exception as err:
|
||||
LOG.exception(_('could not get CPU time for %(id)s: %(e)s'),
|
||||
{'id': instance.id, 'e': err})
|
||||
@@ -62,13 +62,13 @@ class CPUUtilPollster(pollsters.BaseComputePollster):
|
||||
def get_samples(self, manager, cache, resources):
|
||||
self._inspection_duration = self._record_poll_time()
|
||||
for instance in resources:
|
||||
LOG.debug(_('Checking CPU util for instance %s'), instance.id)
|
||||
LOG.debug('Checking CPU util for instance %s', instance.id)
|
||||
try:
|
||||
cpu_info = self.inspector.inspect_cpu_util(
|
||||
instance, self._inspection_duration)
|
||||
LOG.debug(_("CPU UTIL: %(instance)s %(util)d"),
|
||||
({'instance': instance.__dict__,
|
||||
'util': cpu_info.util}))
|
||||
LOG.debug("CPU UTIL: %(instance)s %(util)d",
|
||||
{'instance': instance.__dict__,
|
||||
'util': cpu_info.util})
|
||||
yield util.make_sample_from_instance(
|
||||
instance,
|
||||
name='cpu_util',
|
||||
@@ -78,10 +78,10 @@ class CPUUtilPollster(pollsters.BaseComputePollster):
|
||||
)
|
||||
except virt_inspector.InstanceNotFoundException as err:
|
||||
# Instance was deleted while getting samples. Ignore it.
|
||||
LOG.debug(_('Exception while getting samples %s'), err)
|
||||
LOG.debug('Exception while getting samples %s', err)
|
||||
except ceilometer.NotImplementedError:
|
||||
# Selected inspector does not implement this pollster.
|
||||
LOG.debug(_('Obtaining CPU Util is not implemented for %s'),
|
||||
LOG.debug('Obtaining CPU Util is not implemented for %s',
|
||||
self.inspector.__class__.__name__)
|
||||
except Exception as err:
|
||||
LOG.exception(_('Could not get CPU Util for %(id)s: %(e)s'),
|
||||
|
||||
@@ -128,7 +128,7 @@ class _Base(pollsters.BaseComputePollster):
|
||||
yield s
|
||||
except virt_inspector.InstanceNotFoundException as err:
|
||||
# Instance was deleted while getting samples. Ignore it.
|
||||
LOG.debug(_('Exception while getting samples %s'), err)
|
||||
LOG.debug('Exception while getting samples %s', err)
|
||||
except virt_inspector.InstanceShutOffException as e:
|
||||
LOG.warn(_LW('Instance %(instance_id)s was shut off while '
|
||||
'getting samples of %(pollster)s: %(exc)s'),
|
||||
@@ -136,8 +136,8 @@ class _Base(pollsters.BaseComputePollster):
|
||||
'pollster': self.__class__.__name__, 'exc': e})
|
||||
except ceilometer.NotImplementedError:
|
||||
# Selected inspector does not implement this pollster.
|
||||
LOG.debug(_('%(inspector)s does not provide data for '
|
||||
' %(pollster)s'),
|
||||
LOG.debug('%(inspector)s does not provide data for '
|
||||
' %(pollster)s',
|
||||
{'inspector': self.inspector.__class__.__name__,
|
||||
'pollster': self.__class__.__name__})
|
||||
except Exception as err:
|
||||
@@ -338,11 +338,11 @@ class _DiskRatesPollsterBase(pollsters.BaseComputePollster):
|
||||
yield disk_rate
|
||||
except virt_inspector.InstanceNotFoundException as err:
|
||||
# Instance was deleted while getting samples. Ignore it.
|
||||
LOG.debug(_('Exception while getting samples %s'), err)
|
||||
LOG.debug('Exception while getting samples %s', err)
|
||||
except ceilometer.NotImplementedError:
|
||||
# Selected inspector does not implement this pollster.
|
||||
LOG.debug(_('%(inspector)s does not provide data for '
|
||||
' %(pollster)s'),
|
||||
LOG.debug('%(inspector)s does not provide data for '
|
||||
' %(pollster)s',
|
||||
{'inspector': self.inspector.__class__.__name__,
|
||||
'pollster': self.__class__.__name__})
|
||||
except Exception as err:
|
||||
@@ -520,11 +520,11 @@ class _DiskLatencyPollsterBase(pollsters.BaseComputePollster):
|
||||
yield disk_latency
|
||||
except virt_inspector.InstanceNotFoundException as err:
|
||||
# Instance was deleted while getting samples. Ignore it.
|
||||
LOG.debug(_('Exception while getting samples %s'), err)
|
||||
LOG.debug('Exception while getting samples %s', err)
|
||||
except ceilometer.NotImplementedError:
|
||||
# Selected inspector does not implement this pollster.
|
||||
LOG.debug(_('%(inspector)s does not provide data for '
|
||||
' %(pollster)s'),
|
||||
LOG.debug('%(inspector)s does not provide data for '
|
||||
' %(pollster)s',
|
||||
{'inspector': self.inspector.__class__.__name__,
|
||||
'pollster': self.__class__.__name__})
|
||||
except Exception as err:
|
||||
@@ -601,11 +601,11 @@ class _DiskIOPSPollsterBase(pollsters.BaseComputePollster):
|
||||
yield disk_iops
|
||||
except virt_inspector.InstanceNotFoundException as err:
|
||||
# Instance was deleted while getting samples. Ignore it.
|
||||
LOG.debug(_('Exception while getting samples %s'), err)
|
||||
LOG.debug('Exception while getting samples %s', err)
|
||||
except ceilometer.NotImplementedError:
|
||||
# Selected inspector does not implement this pollster.
|
||||
LOG.debug(_('%(inspector)s does not provide data for '
|
||||
'%(pollster)s'),
|
||||
LOG.debug('%(inspector)s does not provide data for '
|
||||
'%(pollster)s',
|
||||
{'inspector': self.inspector.__class__.__name__,
|
||||
'pollster': self.__class__.__name__})
|
||||
except Exception as err:
|
||||
@@ -696,7 +696,7 @@ class _DiskInfoPollsterBase(pollsters.BaseComputePollster):
|
||||
yield disk_info
|
||||
except virt_inspector.InstanceNotFoundException as err:
|
||||
# Instance was deleted while getting samples. Ignore it.
|
||||
LOG.debug(_('Exception while getting samples %s'), err)
|
||||
LOG.debug('Exception while getting samples %s', err)
|
||||
except virt_inspector.InstanceShutOffException as e:
|
||||
LOG.warn(_LW('Instance %(instance_id)s was shut off while '
|
||||
'getting samples of %(pollster)s: %(exc)s'),
|
||||
@@ -704,10 +704,10 @@ class _DiskInfoPollsterBase(pollsters.BaseComputePollster):
|
||||
'pollster': self.__class__.__name__, 'exc': e})
|
||||
except ceilometer.NotImplementedError:
|
||||
# Selected inspector does not implement this pollster.
|
||||
LOG.debug(_('%(inspector)s does not provide data for '
|
||||
' %(pollster)s'), (
|
||||
LOG.debug('%(inspector)s does not provide data for '
|
||||
' %(pollster)s',
|
||||
{'inspector': self.inspector.__class__.__name__,
|
||||
'pollster': self.__class__.__name__}))
|
||||
'pollster': self.__class__.__name__})
|
||||
except Exception as err:
|
||||
instance_name = util.instance_name(instance)
|
||||
LOG.exception(_('Ignoring instance %(name)s '
|
||||
|
||||
@@ -30,13 +30,13 @@ class MemoryUsagePollster(pollsters.BaseComputePollster):
|
||||
def get_samples(self, manager, cache, resources):
|
||||
self._inspection_duration = self._record_poll_time()
|
||||
for instance in resources:
|
||||
LOG.debug(_('Checking memory usage for instance %s'), instance.id)
|
||||
LOG.debug('Checking memory usage for instance %s', instance.id)
|
||||
try:
|
||||
memory_info = self.inspector.inspect_memory_usage(
|
||||
instance, self._inspection_duration)
|
||||
LOG.debug(_("MEMORY USAGE: %(instance)s %(usage)f"),
|
||||
({'instance': instance.__dict__,
|
||||
'usage': memory_info.usage}))
|
||||
LOG.debug("MEMORY USAGE: %(instance)s %(usage)f",
|
||||
{'instance': instance.__dict__,
|
||||
'usage': memory_info.usage})
|
||||
yield util.make_sample_from_instance(
|
||||
instance,
|
||||
name='memory.usage',
|
||||
@@ -46,7 +46,7 @@ class MemoryUsagePollster(pollsters.BaseComputePollster):
|
||||
)
|
||||
except virt_inspector.InstanceNotFoundException as err:
|
||||
# Instance was deleted while getting samples. Ignore it.
|
||||
LOG.debug(_('Exception while getting samples %s'), err)
|
||||
LOG.debug('Exception while getting samples %s', err)
|
||||
except virt_inspector.InstanceShutOffException as e:
|
||||
LOG.warn(_LW('Instance %(instance_id)s was shut off while '
|
||||
'getting samples of %(pollster)s: %(exc)s'),
|
||||
@@ -59,8 +59,8 @@ class MemoryUsagePollster(pollsters.BaseComputePollster):
|
||||
'instance_id': instance.id, 'exc': e})
|
||||
except ceilometer.NotImplementedError:
|
||||
# Selected inspector does not implement this pollster.
|
||||
LOG.debug(_('Obtaining Memory Usage is not implemented for %s'
|
||||
), self.inspector.__class__.__name__)
|
||||
LOG.debug('Obtaining Memory Usage is not implemented for %s',
|
||||
self.inspector.__class__.__name__)
|
||||
except Exception as err:
|
||||
LOG.exception(_('Could not get Memory Usage for '
|
||||
'%(id)s: %(e)s'), {'id': instance.id,
|
||||
@@ -72,14 +72,14 @@ class MemoryResidentPollster(pollsters.BaseComputePollster):
|
||||
def get_samples(self, manager, cache, resources):
|
||||
self._inspection_duration = self._record_poll_time()
|
||||
for instance in resources:
|
||||
LOG.debug(_('Checking resident memory for instance %s'),
|
||||
LOG.debug('Checking resident memory for instance %s',
|
||||
instance.id)
|
||||
try:
|
||||
memory_info = self.inspector.inspect_memory_resident(
|
||||
instance, self._inspection_duration)
|
||||
LOG.debug(_("RESIDENT MEMORY: %(instance)s %(resident)f"),
|
||||
({'instance': instance.__dict__,
|
||||
'resident': memory_info.resident}))
|
||||
LOG.debug("RESIDENT MEMORY: %(instance)s %(resident)f",
|
||||
{'instance': instance.__dict__,
|
||||
'resident': memory_info.resident})
|
||||
yield util.make_sample_from_instance(
|
||||
instance,
|
||||
name='memory.resident',
|
||||
@@ -89,7 +89,7 @@ class MemoryResidentPollster(pollsters.BaseComputePollster):
|
||||
)
|
||||
except virt_inspector.InstanceNotFoundException as err:
|
||||
# Instance was deleted while getting samples. Ignore it.
|
||||
LOG.debug(_('Exception while getting samples %s'), err)
|
||||
LOG.debug('Exception while getting samples %s', err)
|
||||
except virt_inspector.InstanceShutOffException as e:
|
||||
LOG.warn(_LW('Instance %(instance_id)s was shut off while '
|
||||
'getting samples of %(pollster)s: %(exc)s'),
|
||||
@@ -102,8 +102,8 @@ class MemoryResidentPollster(pollsters.BaseComputePollster):
|
||||
'instance_id': instance.id, 'exc': e})
|
||||
except ceilometer.NotImplementedError:
|
||||
# Selected inspector does not implement this pollster.
|
||||
LOG.debug(_('Obtaining Resident Memory is not implemented'
|
||||
' for %s'), self.inspector.__class__.__name__)
|
||||
LOG.debug('Obtaining Resident Memory is not implemented'
|
||||
' for %s', self.inspector.__class__.__name__)
|
||||
except Exception as err:
|
||||
LOG.exception(_LE('Could not get Resident Memory Usage for '
|
||||
'%(id)s: %(e)s'), {'id': instance.id,
|
||||
|
||||
@@ -89,7 +89,7 @@ class _Base(pollsters.BaseComputePollster):
|
||||
self._inspection_duration = self._record_poll_time()
|
||||
for instance in resources:
|
||||
instance_name = util.instance_name(instance)
|
||||
LOG.debug(_('checking net info for instance %s'), instance.id)
|
||||
LOG.debug('checking net info for instance %s', instance.id)
|
||||
try:
|
||||
vnics = self._get_vnics_for_instance(
|
||||
cache,
|
||||
@@ -103,7 +103,7 @@ class _Base(pollsters.BaseComputePollster):
|
||||
yield self._get_sample(instance, vnic, info)
|
||||
except virt_inspector.InstanceNotFoundException as err:
|
||||
# Instance was deleted while getting samples. Ignore it.
|
||||
LOG.debug(_('Exception while getting samples %s'), err)
|
||||
LOG.debug('Exception while getting samples %s', err)
|
||||
except virt_inspector.InstanceShutOffException as e:
|
||||
LOG.warn(_LW('Instance %(instance_id)s was shut off while '
|
||||
'getting samples of %(pollster)s: %(exc)s'),
|
||||
@@ -111,8 +111,8 @@ class _Base(pollsters.BaseComputePollster):
|
||||
'pollster': self.__class__.__name__, 'exc': e})
|
||||
except ceilometer.NotImplementedError:
|
||||
# Selected inspector does not implement this pollster.
|
||||
LOG.debug(_('%(inspector)s does not provide data for '
|
||||
' %(pollster)s'),
|
||||
LOG.debug('%(inspector)s does not provide data for '
|
||||
' %(pollster)s',
|
||||
{'inspector': self.inspector.__class__.__name__,
|
||||
'pollster': self.__class__.__name__})
|
||||
except Exception as err:
|
||||
|
||||
@@ -51,7 +51,7 @@ def retry_on_disconnect(function):
|
||||
if (e.get_error_code() == libvirt.VIR_ERR_SYSTEM_ERROR and
|
||||
e.get_error_domain() in (libvirt.VIR_FROM_REMOTE,
|
||||
libvirt.VIR_FROM_RPC)):
|
||||
LOG.debug(_('Connection to libvirt broken'))
|
||||
LOG.debug('Connection to libvirt broken')
|
||||
self.connection = None
|
||||
return function(self, *args, **kwargs)
|
||||
else:
|
||||
@@ -76,7 +76,7 @@ class LibvirtInspector(virt_inspector.Inspector):
|
||||
global libvirt
|
||||
if libvirt is None:
|
||||
libvirt = __import__('libvirt')
|
||||
LOG.debug(_('Connecting to libvirt: %s'), self.uri)
|
||||
LOG.debug('Connecting to libvirt: %s', self.uri)
|
||||
self.connection = libvirt.openReadOnly(self.uri)
|
||||
|
||||
return self.connection
|
||||
|
||||
Reference in New Issue
Block a user