Replace LOG.warn with LOG.warning
Python 3 deprecated the logger.warn method. we prefer to use warning to avoid DeprecationWarning. refer to: https://docs.python.org/3/library/logging.html#logging.warning Change-Id: Ib85c55feabad8650661ea7fa521ba3093b07857b
This commit is contained in:
@@ -134,8 +134,8 @@ class ThresholdEvaluator(evaluator.Evaluator):
|
|||||||
"""
|
"""
|
||||||
sufficient = len(statistics) >= alarm.rule['evaluation_periods']
|
sufficient = len(statistics) >= alarm.rule['evaluation_periods']
|
||||||
if not sufficient and alarm.state != evaluator.UNKNOWN:
|
if not sufficient and alarm.state != evaluator.UNKNOWN:
|
||||||
LOG.warn(_LW('Expecting %(expected)d datapoints but only get '
|
LOG.warning(_LW('Expecting %(expected)d datapoints but only get '
|
||||||
'%(actual)d') % {
|
'%(actual)d') % {
|
||||||
'expected': alarm.rule['evaluation_periods'],
|
'expected': alarm.rule['evaluation_periods'],
|
||||||
'actual': len(statistics)})
|
'actual': len(statistics)})
|
||||||
# Reason is not same as log message because we want to keep
|
# Reason is not same as log message because we want to keep
|
||||||
|
|||||||
@@ -227,9 +227,9 @@ def create_tables(conn, tables, column_families):
|
|||||||
separator=conn.table_prefix_separator,
|
separator=conn.table_prefix_separator,
|
||||||
table_name=table))
|
table_name=table))
|
||||||
|
|
||||||
LOG.warn(_("Cannot create table %(table_name)s "
|
LOG.warning(_("Cannot create table %(table_name)s "
|
||||||
"it already exists. Ignoring error")
|
"it already exists. Ignoring error")
|
||||||
% {'table_name': table})
|
% {'table_name': table})
|
||||||
|
|
||||||
|
|
||||||
def quote(s, *args):
|
def quote(s, *args):
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ class ConnectionPool(object):
|
|||||||
retry_interval,
|
retry_interval,
|
||||||
)
|
)
|
||||||
except pymongo.errors.ConnectionFailure as e:
|
except pymongo.errors.ConnectionFailure as e:
|
||||||
LOG.warn(_('Unable to connect to the database server: '
|
LOG.warning(_('Unable to connect to the database server: '
|
||||||
'%(errmsg)s.') % {'errmsg': e})
|
'%(errmsg)s.') % {'errmsg': e})
|
||||||
raise
|
raise
|
||||||
self._pool[pool_key] = weakref.ref(client)
|
self._pool[pool_key] = weakref.ref(client)
|
||||||
return client
|
return client
|
||||||
|
|||||||
Reference in New Issue
Block a user