diff options
author | Takashi Kajinami <tkajinam@redhat.com> | 2021-11-29 15:48:25 +0900 |
---|---|---|
committer | Takashi Kajinami <tkajinam@redhat.com> | 2022-01-19 13:38:21 +0900 |
commit | 2a5ef1b9339e5c739d9271b0f991e24f73495fc5 (patch) | |
tree | ee427c2204cac810ad294e438aaf9b679b82d0dd /tempest/hacking | |
parent | daeae9c8a586ac60f7e9dfc486822fd80f1da136 (diff) | |
download | tempest-2a5ef1b9339e5c739d9271b0f991e24f73495fc5.tar.gz |
Use LOG.warning instead of deprecated LOG.warn
The LOG.warn method is deprecated[1] and the LOG.warning method should
be used instead.
[1] https://docs.python.org/3/library/logging.html#logging.warning
Change-Id: I43e2269d4b1c425119c86919eb869941d621c6de
Diffstat (limited to 'tempest/hacking')
-rw-r--r-- | tempest/hacking/checks.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py index c1e6b2d12..1c9c55b12 100644 --- a/tempest/hacking/checks.py +++ b/tempest/hacking/checks.py @@ -318,3 +318,16 @@ def negative_test_attribute_always_applied_to_negative_tests(physical_line, " to all negative API tests" ) _HAVE_NEGATIVE_DECORATOR = False + + +@core.flake8ext +def no_log_warn(logical_line): + """Disallow 'LOG.warn(' + + Use LOG.warning() instead of Deprecated LOG.warn(). + https://docs.python.org/3/library/logging.html#logging.warning + """ + + msg = ("T118: LOG.warn is deprecated, please use LOG.warning!") + if "LOG.warn(" in logical_line: + yield (0, msg) |