Merge "Improve Rally Logging (part 1)"

This commit is contained in:
Jenkins 2017-09-27 18:25:53 +00:00 committed by Gerrit Code Review
commit 9b2c6564cb
2 changed files with 0 additions and 26 deletions

View File

@ -177,24 +177,6 @@ def check_import_of_logging(logical_line, physical_line, filename):
"use `rally.common.logging` instead.")
@skip_ignored_lines
def no_translate_debug_logs(logical_line, physical_line, filename):
"""Check for "LOG.debug(_("
As per our translation policy,
https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation
we shouldn't translate debug level logs.
* This check assumes that 'LOG' is a logger.
* Use filename so we can start enforcing this in specific folders instead
of needing to do so all at once.
N311
"""
if logical_line.startswith("LOG.debug(_("):
yield(0, "N311 Don't translate debug level logs")
@skip_ignored_lines
def no_use_conf_debug_check(logical_line, physical_line, filename):
"""Check for "cfg.CONF.debug"
@ -606,7 +588,6 @@ def check_opts_import_path(logical_line, physical_line, filename):
def factory(register):
register(check_assert_methods_from_mock)
register(check_import_of_logging)
register(no_translate_debug_logs)
register(no_use_conf_debug_check)
register(assert_true_instance)
register(assert_equal_type)

View File

@ -112,13 +112,6 @@ class HackingTestCase(test.TestCase):
checkres = checks.check_import_of_logging(good, good, "fakefile")
self.assertEqual([], list(checkres))
def test_no_translate_debug_logs(self):
bad_samples = ["LOG.debug(_('foo'))"]
self._assert_bad_samples(checks.no_translate_debug_logs, bad_samples)
good_samples = ["LOG.debug('foo')", "LOG.info(_('foo'))"]
self._assert_good_samples(checks.no_translate_debug_logs, good_samples)
def test_no_use_conf_debug_check(self):
bad_samples = [
"if CONF.debug:",