From eb8a07aacf2eeff9c91397d208a9c964cec8b4e6 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Fri, 24 May 2024 11:54:13 -0400 Subject: [PATCH] Use log.warning() from the logging library Every time I run a large chunk of neutron unit tests, for example: $ tox -e py310 -- neutron.tests.unit.plugins.ml2.drivers I see this warning (it doesn't cause a failure): Captured stderr: ~~~~~~~~~~~~~~~~ .../neutron/.tox/py310/lib/python3.10/site-packages/ovs/db/idl.py:1484: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead vlog.warn("error parsing column %s in table %s: %s" Looking at the OVS python library code it seems perfectly fine. Backtracking, I was able to find the offending code that actually lived in ovsdbapp. It is a little bit obfuscated as it was re-mapping the OVS library vlog.Vlog.warn() call to log.warn(), but I was able to test my theory by modifying code in my local neutron .tox directory and the warning went away. I was never able to narrow things down to a single test, or class, or file, even running with '--concurrency 1', so I do not know exactly how this code is getting exercised, there could be a test that is not cleaning-up properly, maybe some day we will figure that out. TrivialFix but not TrivialToFind Change-Id: Ic6256b4bab48298fe599b7904e9edb0e35b93ce4 --- ovsdbapp/backend/ovs_idl/vlog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ovsdbapp/backend/ovs_idl/vlog.py b/ovsdbapp/backend/ovs_idl/vlog.py index 35df619b..a461da87 100644 --- a/ovsdbapp/backend/ovs_idl/vlog.py +++ b/ovsdbapp/backend/ovs_idl/vlog.py @@ -31,7 +31,7 @@ _LOG = logging.getLogger(__name__) # Map local log LEVELS to local LOG functions CRITICAL = _LOG.critical ERROR = _LOG.error -WARN = _LOG.warn +WARN = _LOG.warning INFO = _LOG.info DEBUG = _LOG.debug