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: Ib88d6b3b5583c564ad2b43dab4a54da870753547
Closes-Bug: #1530742
This commit is contained in:
zhangguoqing 2016-01-04 04:09:49 +00:00
parent ecf25ff2aa
commit 8ca7ece349
1 changed files with 3 additions and 2 deletions

View File

@ -29,8 +29,9 @@ def safe_rstrip(value, chars=None):
:return: Stripped value.
"""
if not isinstance(value, six.string_types):
LOG.warn(_LW("Failed to remove trailing character. Returning original "
"object. Supplied object is not a string: %s,"), value)
LOG.warn(_LW("Failed to remove trailing character. Returning "
"original object. Supplied object is not a string: %s,"),
value)
return value
return value.rstrip(chars) or value