From dfc9a3b37d69e5a87a402b3283d1c0c96b2bfffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Antal?= Date: Fri, 15 Jan 2016 16:49:32 +0100 Subject: [PATCH] Removed use of deprecated LOG.warn method LOG.warn is deprecated. We were still used it some places. So I replaced the LOG.warn method to LOG.warning, which is not deprecated. Change-Id: I9461cec569445ad6c40db9ce2feeeba1ef0af0e3 Closes-Bug: #1508442 --- watcher/common/messaging/messaging_handler.py | 2 +- watcher/common/utils.py | 5 +++-- watcher/decision_engine/model/mapping.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/watcher/common/messaging/messaging_handler.py b/watcher/common/messaging/messaging_handler.py index 7dad74556..fc2cfeebe 100644 --- a/watcher/common/messaging/messaging_handler.py +++ b/watcher/common/messaging/messaging_handler.py @@ -94,7 +94,7 @@ class MessagingHandler(threading.Thread): ) self.__server = self.build_server(target) else: - LOG.warn( + LOG.warning( _LW("No endpoint defined; can only publish events")) except Exception as e: LOG.exception(e) diff --git a/watcher/common/utils.py b/watcher/common/utils.py index 00221d7fe..1bdacaf7e 100644 --- a/watcher/common/utils.py +++ b/watcher/common/utils.py @@ -50,8 +50,9 @@ def safe_rstrip(value, chars=None): """ 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.warning(_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 diff --git a/watcher/decision_engine/model/mapping.py b/watcher/decision_engine/model/mapping.py index b9cd1eb7e..3d196630a 100644 --- a/watcher/decision_engine/model/mapping.py +++ b/watcher/decision_engine/model/mapping.py @@ -72,7 +72,7 @@ class Mapping(object): # remove vm self.mapping_vm.pop(vm_uuid) else: - LOG.warn( + LOG.warning( "trying to delete the virtual machine {0} but it was not " "found on hypervisor {1}".format( vm_uuid, node_uuid))