Merge "Replace deprecated LOG.warn with LOG.warning"

This commit is contained in:
Jenkins 2016-03-12 03:40:27 +00:00 committed by Gerrit Code Review
commit 4ea1ade893
3 changed files with 13 additions and 13 deletions

View File

@ -195,11 +195,11 @@ class PikaDriver(base.BaseDriver):
self._declare_rpc_exchange(exchange, self._declare_rpc_exchange(exchange,
expiration_time - time.time()) expiration_time - time.time())
except pika_drv_exc.ConnectionException as e: except pika_drv_exc.ConnectionException as e:
LOG.warn("Problem during declaring exchange. %", e) LOG.warning("Problem during declaring exchange. %", e)
return True return True
elif isinstance(ex, (pika_drv_exc.ConnectionException, elif isinstance(ex, (pika_drv_exc.ConnectionException,
exceptions.MessageDeliveryFailure)): exceptions.MessageDeliveryFailure)):
LOG.warn("Problem during message sending. %s", ex) LOG.warning("Problem during message sending. %s", ex)
return True return True
else: else:
return False return False
@ -240,7 +240,7 @@ class PikaDriver(base.BaseDriver):
self._declare_rpc_exchange(exchange, self._declare_rpc_exchange(exchange,
expiration_time - time.time()) expiration_time - time.time())
except pika_drv_exc.ConnectionException as e: except pika_drv_exc.ConnectionException as e:
LOG.warn("Problem during declaring exchange. %", e) LOG.warning("Problem during declaring exchange. %", e)
raise ex raise ex
if reply is not None: if reply is not None:
@ -269,7 +269,7 @@ class PikaDriver(base.BaseDriver):
exchange, expiration_time - time.time() exchange, expiration_time - time.time()
) )
except pika_drv_exc.ConnectionException as e: except pika_drv_exc.ConnectionException as e:
LOG.warn("Problem during declaring exchange. %", e) LOG.warning("Problem during declaring exchange. %", e)
def _declare_notification_queue_binding(self, target, timeout=None): def _declare_notification_queue_binding(self, target, timeout=None):
if timeout is not None and timeout < 0: if timeout is not None and timeout < 0:
@ -303,16 +303,16 @@ class PikaDriver(base.BaseDriver):
def on_exception(ex): def on_exception(ex):
if isinstance(ex, (pika_drv_exc.ExchangeNotFoundException, if isinstance(ex, (pika_drv_exc.ExchangeNotFoundException,
pika_drv_exc.RoutingException)): pika_drv_exc.RoutingException)):
LOG.warn("Problem during sending notification. %", ex) LOG.warning("Problem during sending notification. %", ex)
try: try:
self._declare_notification_queue_binding(target) self._declare_notification_queue_binding(target)
except pika_drv_exc.ConnectionException as e: except pika_drv_exc.ConnectionException as e:
LOG.warn("Problem during declaring notification queue " LOG.warning("Problem during declaring notification queue "
"binding. %", e) "binding. %", e)
return True return True
elif isinstance(ex, (pika_drv_exc.ConnectionException, elif isinstance(ex, (pika_drv_exc.ConnectionException,
pika_drv_exc.MessageRejectedException)): pika_drv_exc.MessageRejectedException)):
LOG.warn("Problem during sending notification. %", ex) LOG.warning("Problem during sending notification. %", ex)
return True return True
else: else:
return False return False

View File

@ -270,9 +270,9 @@ class PikaEngine(object):
pika_next_connection_num, for_listening pika_next_connection_num, for_listening
) )
except pika_pool.Connection.connectivity_errors as e: except pika_pool.Connection.connectivity_errors as e:
LOG.warn("Can't establish connection to host. %s", e) LOG.warning("Can't establish connection to host. %s", e)
except pika_drv_exc.HostConnectionNotAllowedException as e: except pika_drv_exc.HostConnectionNotAllowedException as e:
LOG.warn("Connection to host is not allowed. %s", e) LOG.warning("Connection to host is not allowed. %s", e)
connection_attempts -= 1 connection_attempts -= 1
pika_next_connection_num += 1 pika_next_connection_num += 1
@ -292,7 +292,7 @@ class PikaEngine(object):
int(self._tcp_user_timeout * 1000) int(self._tcp_user_timeout * 1000)
) )
except socket.error: except socket.error:
LOG.warn( LOG.warning(
"Whoops, this kernel doesn't seem to support TCP_USER_TIMEOUT." "Whoops, this kernel doesn't seem to support TCP_USER_TIMEOUT."
) )

View File

@ -195,7 +195,7 @@ class RpcPikaIncomingMessage(PikaIncomingMessage, base.RpcIncomingMessage):
def on_exception(ex): def on_exception(ex):
if isinstance(ex, pika_drv_exc.ConnectionException): if isinstance(ex, pika_drv_exc.ConnectionException):
LOG.warn( LOG.warning(
"Connectivity related problem during reply sending. %s", "Connectivity related problem during reply sending. %s",
ex ex
) )
@ -276,7 +276,7 @@ class RpcReplyPikaIncomingMessage(PikaIncomingMessage):
res_exc = ex_type(module_name, class_name, message, trace) res_exc = ex_type(module_name, class_name, message, trace)
except ImportError as e: except ImportError as e:
LOG.warn( LOG.warning(
"Can not deserialize remote exception [module:%s, " "Can not deserialize remote exception [module:%s, "
"class:%s]. %s", module_name, class_name, e "class:%s]. %s", module_name, class_name, e
) )