From 6d2d1b2cfe5fa88dc7b05f72ed104d6474c6d34e Mon Sep 17 00:00:00 2001 From: "Swapnil Kulkarni (coolsvap)" Date: Fri, 11 Mar 2016 12:49:09 +0530 Subject: [PATCH] Replace deprecated LOG.warn with LOG.warning LOG.warn is deprecated. It still used in a few places. Updated to non-deprecated LOG.warning. Change-Id: I124357c259e3cc6c1c8f4cad48c6cb19c1ac2a77 Closes-Bug:#1508442 --- oslo_messaging/_drivers/impl_pika.py | 16 ++++++++-------- .../_drivers/pika_driver/pika_engine.py | 6 +++--- .../_drivers/pika_driver/pika_message.py | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/oslo_messaging/_drivers/impl_pika.py b/oslo_messaging/_drivers/impl_pika.py index faa3e3bce..9f47102d5 100644 --- a/oslo_messaging/_drivers/impl_pika.py +++ b/oslo_messaging/_drivers/impl_pika.py @@ -195,11 +195,11 @@ class PikaDriver(base.BaseDriver): self._declare_rpc_exchange(exchange, expiration_time - time.time()) except pika_drv_exc.ConnectionException as e: - LOG.warn("Problem during declaring exchange. %", e) + LOG.warning("Problem during declaring exchange. %", e) return True elif isinstance(ex, (pika_drv_exc.ConnectionException, exceptions.MessageDeliveryFailure)): - LOG.warn("Problem during message sending. %s", ex) + LOG.warning("Problem during message sending. %s", ex) return True else: return False @@ -240,7 +240,7 @@ class PikaDriver(base.BaseDriver): self._declare_rpc_exchange(exchange, expiration_time - time.time()) except pika_drv_exc.ConnectionException as e: - LOG.warn("Problem during declaring exchange. %", e) + LOG.warning("Problem during declaring exchange. %", e) raise ex if reply is not None: @@ -269,7 +269,7 @@ class PikaDriver(base.BaseDriver): exchange, expiration_time - time.time() ) 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): if timeout is not None and timeout < 0: @@ -303,16 +303,16 @@ class PikaDriver(base.BaseDriver): def on_exception(ex): if isinstance(ex, (pika_drv_exc.ExchangeNotFoundException, pika_drv_exc.RoutingException)): - LOG.warn("Problem during sending notification. %", ex) + LOG.warning("Problem during sending notification. %", ex) try: self._declare_notification_queue_binding(target) except pika_drv_exc.ConnectionException as e: - LOG.warn("Problem during declaring notification queue " - "binding. %", e) + LOG.warning("Problem during declaring notification queue " + "binding. %", e) return True elif isinstance(ex, (pika_drv_exc.ConnectionException, pika_drv_exc.MessageRejectedException)): - LOG.warn("Problem during sending notification. %", ex) + LOG.warning("Problem during sending notification. %", ex) return True else: return False diff --git a/oslo_messaging/_drivers/pika_driver/pika_engine.py b/oslo_messaging/_drivers/pika_driver/pika_engine.py index a8c9a712f..f5593c4e6 100644 --- a/oslo_messaging/_drivers/pika_driver/pika_engine.py +++ b/oslo_messaging/_drivers/pika_driver/pika_engine.py @@ -270,9 +270,9 @@ class PikaEngine(object): pika_next_connection_num, for_listening ) 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: - LOG.warn("Connection to host is not allowed. %s", e) + LOG.warning("Connection to host is not allowed. %s", e) connection_attempts -= 1 pika_next_connection_num += 1 @@ -292,7 +292,7 @@ class PikaEngine(object): int(self._tcp_user_timeout * 1000) ) except socket.error: - LOG.warn( + LOG.warning( "Whoops, this kernel doesn't seem to support TCP_USER_TIMEOUT." ) diff --git a/oslo_messaging/_drivers/pika_driver/pika_message.py b/oslo_messaging/_drivers/pika_driver/pika_message.py index 4726c489c..4ee4e9a12 100644 --- a/oslo_messaging/_drivers/pika_driver/pika_message.py +++ b/oslo_messaging/_drivers/pika_driver/pika_message.py @@ -195,7 +195,7 @@ class RpcPikaIncomingMessage(PikaIncomingMessage, base.RpcIncomingMessage): def on_exception(ex): if isinstance(ex, pika_drv_exc.ConnectionException): - LOG.warn( + LOG.warning( "Connectivity related problem during reply sending. %s", ex ) @@ -276,7 +276,7 @@ class RpcReplyPikaIncomingMessage(PikaIncomingMessage): res_exc = ex_type(module_name, class_name, message, trace) except ImportError as e: - LOG.warn( + LOG.warning( "Can not deserialize remote exception [module:%s, " "class:%s]. %s", module_name, class_name, e )