Merge "Replace warnings.warn in sqlalchemy-api"
This commit is contained in:
commit
e41f63a3b3
@ -25,7 +25,6 @@ import sys
|
|||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
import warnings
|
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_db import exception as db_exc
|
from oslo_db import exception as db_exc
|
||||||
@ -109,8 +108,8 @@ def get_backend():
|
|||||||
def is_admin_context(context):
|
def is_admin_context(context):
|
||||||
"""Indicates if the request context is an administrator."""
|
"""Indicates if the request context is an administrator."""
|
||||||
if not context:
|
if not context:
|
||||||
warnings.warn(_('Use of empty request context is deprecated'),
|
LOG.warning(_LW('Use of empty request context is deprecated'),
|
||||||
DeprecationWarning)
|
DeprecationWarning)
|
||||||
raise Exception('die')
|
raise Exception('die')
|
||||||
return context.is_admin
|
return context.is_admin
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user