Change LOG.warn to LOG.warning

Python 3 deprecated the logger.warn method, see:
https://docs.python.org/3/library/logging.html#logging.warning
so we prefer to use warning to avoid DeprecationWarning.

Change-Id: I3b8651ee69c9c817ad47db13b06f2f92077a3923
Closes-Bug: #1530742
This commit is contained in:
zhangguoqing 2016-01-04 13:25:08 +00:00
parent ed063862bf
commit 0161d781ae
1 changed files with 2 additions and 2 deletions

View File

@ -65,8 +65,8 @@ def _session(context):
def is_admin_context(context):
"""Indicates if the request context is an administrator."""
if not context:
LOG.warn(_('Use of empty request context is deprecated'),
DeprecationWarning)
LOG.warning(_('Use of empty request context is deprecated'),
DeprecationWarning)
raise Exception('die')
return context.is_admin