From a809220fde006a0ae104c71d16ad270c7fa8a5a4 Mon Sep 17 00:00:00 2001 From: Ankit Agrawal Date: Tue, 3 Nov 2015 01:43:27 -0800 Subject: [PATCH] Replace warnings.warn in sqlalchemy-api There is a warning message logged by warnings.warn, it should be replaced by LOG.warning. Change-Id: Ifcff0ebeb13b07420f6b8073b094c3b1687999e8 --- cinder/db/sqlalchemy/api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cinder/db/sqlalchemy/api.py b/cinder/db/sqlalchemy/api.py index 5ed047e59..47a84492e 100644 --- a/cinder/db/sqlalchemy/api.py +++ b/cinder/db/sqlalchemy/api.py @@ -25,7 +25,6 @@ import sys import threading import time import uuid -import warnings from oslo_config import cfg from oslo_db import exception as db_exc @@ -109,8 +108,8 @@ def get_backend(): def is_admin_context(context): """Indicates if the request context is an administrator.""" if not context: - warnings.warn(_('Use of empty request context is deprecated'), - DeprecationWarning) + LOG.warning(_LW('Use of empty request context is deprecated'), + DeprecationWarning) raise Exception('die') return context.is_admin -- 2.45.2