Merge "Do not log a warning about not using compute monitors" into stable/stein
This commit is contained in:
commit
3c19e71b48
@ -84,6 +84,8 @@ class MonitorHandler(object):
|
|||||||
if namespace + '.' + ext.name in cfg_monitors:
|
if namespace + '.' + ext.name in cfg_monitors:
|
||||||
self.type_monitor_loaded[namespace] = ext.name
|
self.type_monitor_loaded[namespace] = ext.name
|
||||||
return True
|
return True
|
||||||
|
# Only log something if compute_monitors is not empty.
|
||||||
|
if CONF.compute_monitors:
|
||||||
LOG.warning("Excluding %(namespace)s monitor %(monitor_name)s. "
|
LOG.warning("Excluding %(namespace)s monitor %(monitor_name)s. "
|
||||||
"Not in the list of enabled monitors "
|
"Not in the list of enabled monitors "
|
||||||
"(CONF.compute_monitors).",
|
"(CONF.compute_monitors).",
|
||||||
|
@ -113,10 +113,10 @@ a time.
|
|||||||
Possible values:
|
Possible values:
|
||||||
|
|
||||||
* An empty list will disable the feature (Default).
|
* An empty list will disable the feature (Default).
|
||||||
* An example value that would enable both the CPU and NUMA memory
|
* An example value that would enable the CPU
|
||||||
bandwidth monitors that use the virt driver variant:
|
bandwidth monitor that uses the virt driver variant::
|
||||||
|
|
||||||
compute_monitors = cpu.virt_driver, numa_mem_bw.virt_driver
|
compute_monitors = cpu.virt_driver
|
||||||
"""),
|
"""),
|
||||||
cfg.StrOpt('default_ephemeral_format',
|
cfg.StrOpt('default_ephemeral_format',
|
||||||
help="""
|
help="""
|
||||||
|
@ -51,3 +51,12 @@ class MonitorsTestCase(test.NoDBTestCase):
|
|||||||
'mon2')
|
'mon2')
|
||||||
self.assertTrue(handler.check_enabled_monitor(ext_cpu_mon1))
|
self.assertTrue(handler.check_enabled_monitor(ext_cpu_mon1))
|
||||||
self.assertFalse(handler.check_enabled_monitor(ext_cpu_mon2))
|
self.assertFalse(handler.check_enabled_monitor(ext_cpu_mon2))
|
||||||
|
|
||||||
|
# Run the check but with no monitors enabled to make sure we don't log.
|
||||||
|
self.flags(compute_monitors=[])
|
||||||
|
handler = monitors.MonitorHandler(None)
|
||||||
|
ext_cpu_mon1 = FakeExt('nova.compute.monitors.cpu.virt_driver:Monitor',
|
||||||
|
'mon1')
|
||||||
|
with mock.patch.object(monitors.LOG, 'warning') as mock_warning:
|
||||||
|
self.assertFalse(handler.check_enabled_monitor(ext_cpu_mon1))
|
||||||
|
mock_warning.assert_not_called()
|
||||||
|
Loading…
Reference in New Issue
Block a user