summaryrefslogtreecommitdiff
path: root/taskflow/engines
diff options
context:
space:
mode:
authorxhzhf <guoyongxhzhf@163.com>2016-12-18 08:30:51 +0800
committerxhzhf <guoyongxhzhf@163.com>2017-03-07 09:29:26 +0000
commit4e0125e4e52e67af0bf1bd84244fb6cb80e09abf (patch)
tree93b97131e5aa8a6bda34fff793b9e2c2cad67f74 /taskflow/engines
parent96228d861633ab5d33add270e556a6f2e01aee40 (diff)
downloadtaskflow-4e0125e4e52e67af0bf1bd84244fb6cb80e09abf.tar.gz
python3.0 has deprecated LOG.warn
python3.0 has deprecated LOG.warn https://docs.python.org/3/library/logging.html#logging.warning Closes-Bug: #1650843 Change-Id: Ib8473cbdb84547f385e619fe08ed723b1ee7bcdb
Diffstat (limited to 'taskflow/engines')
-rw-r--r--taskflow/engines/action_engine/process_executor.py8
-rw-r--r--taskflow/engines/worker_based/dispatcher.py6
-rw-r--r--taskflow/engines/worker_based/proxy.py6
-rw-r--r--taskflow/engines/worker_based/server.py40
4 files changed, 31 insertions, 29 deletions
diff --git a/taskflow/engines/action_engine/process_executor.py b/taskflow/engines/action_engine/process_executor.py
index e59852f..85d37e0 100644
--- a/taskflow/engines/action_engine/process_executor.py
+++ b/taskflow/engines/action_engine/process_executor.py
@@ -504,16 +504,16 @@ class DispatcherHandler(asyncore.dispatcher):
try:
self.reader.feed(data)
except (IOError, UnknownSender):
- LOG.warn("Invalid received message", exc_info=True)
+ LOG.warning("Invalid received message", exc_info=True)
self.handle_close()
except _DECODE_ENCODE_ERRORS:
- LOG.warn("Badly formatted message", exc_info=True)
+ LOG.warning("Badly formatted message", exc_info=True)
self.handle_close()
except (ValueError, su.ValidationError):
- LOG.warn("Failed validating message", exc_info=True)
+ LOG.warning("Failed validating message", exc_info=True)
self.handle_close()
except ChallengeIgnored:
- LOG.warn("Failed challenge sequence", exc_info=True)
+ LOG.warning("Failed challenge sequence", exc_info=True)
self.handle_close()
diff --git a/taskflow/engines/worker_based/dispatcher.py b/taskflow/engines/worker_based/dispatcher.py
index 2735073..c6e5d25 100644
--- a/taskflow/engines/worker_based/dispatcher.py
+++ b/taskflow/engines/worker_based/dispatcher.py
@@ -135,9 +135,9 @@ class TypeDispatcher(object):
except excp.InvalidFormat as e:
message.reject_log_error(
logger=LOG, errors=(kombu_exc.MessageStateError,))
- LOG.warn("Message '%s' (%s) was rejected due to it being"
- " in an invalid format: %s",
- ku.DelayedPretty(message), message_type, e)
+ LOG.warning("Message '%s' (%s) was rejected due to it"
+ " being in an invalid format: %s",
+ ku.DelayedPretty(message), message_type, e)
return
message.ack_log_error(logger=LOG,
errors=(kombu_exc.MessageStateError,))
diff --git a/taskflow/engines/worker_based/proxy.py b/taskflow/engines/worker_based/proxy.py
index 386e377..e58c7a2 100644
--- a/taskflow/engines/worker_based/proxy.py
+++ b/taskflow/engines/worker_based/proxy.py
@@ -162,9 +162,9 @@ class Proxy(object):
# Filter out any empty keys...
routing_keys = [r_k for r_k in routing_keys if r_k]
if not routing_keys:
- LOG.warn("No routing key/s specified; unable to send '%s'"
- " to any target queue on exchange '%s'", msg,
- self._exchange_name)
+ LOG.warning("No routing key/s specified; unable to send '%s'"
+ " to any target queue on exchange '%s'", msg,
+ self._exchange_name)
return
def _publish(producer, routing_key):
diff --git a/taskflow/engines/worker_based/server.py b/taskflow/engines/worker_based/server.py
index 978ab3a..40c8e56 100644
--- a/taskflow/engines/worker_based/server.py
+++ b/taskflow/engines/worker_based/server.py
@@ -142,9 +142,9 @@ class Server(object):
try:
reply_to = message.properties['reply_to']
except KeyError:
- LOG.warn("The 'reply_to' message property is missing"
- " in received notify message '%s'",
- ku.DelayedPretty(message), exc_info=True)
+ LOG.warning("The 'reply_to' message property is missing"
+ " in received notify message '%s'",
+ ku.DelayedPretty(message), exc_info=True)
else:
response = pr.Notify(topic=self._topic,
tasks=self._endpoints.keys())
@@ -177,8 +177,9 @@ class Server(object):
work = pr.Request.from_dict(request, task_uuid=task_uuid)
except ValueError:
with misc.capture_failure() as failure:
- LOG.warn("Failed to parse request contents from message '%s'",
- ku.DelayedPretty(message), exc_info=True)
+ LOG.warning("Failed to parse request contents"
+ " from message '%s'",
+ ku.DelayedPretty(message), exc_info=True)
reply_callback(result=pr.failure_to_dict(failure))
return
@@ -187,10 +188,10 @@ class Server(object):
endpoint = self._endpoints[work.task_cls]
except KeyError:
with misc.capture_failure() as failure:
- LOG.warn("The '%s' task endpoint does not exist, unable"
- " to continue processing request message '%s'",
- work.task_cls, ku.DelayedPretty(message),
- exc_info=True)
+ LOG.warning("The '%s' task endpoint does not exist, unable"
+ " to continue processing request message '%s'",
+ work.task_cls, ku.DelayedPretty(message),
+ exc_info=True)
reply_callback(result=pr.failure_to_dict(failure))
return
else:
@@ -198,10 +199,10 @@ class Server(object):
handler = getattr(endpoint, work.action)
except AttributeError:
with misc.capture_failure() as failure:
- LOG.warn("The '%s' handler does not exist on task endpoint"
- " '%s', unable to continue processing request"
- " message '%s'", work.action, endpoint,
- ku.DelayedPretty(message), exc_info=True)
+ LOG.warning("The '%s' handler does not exist on task"
+ " endpoint '%s', unable to continue processing"
+ " request message '%s'", work.action, endpoint,
+ ku.DelayedPretty(message), exc_info=True)
reply_callback(result=pr.failure_to_dict(failure))
return
else:
@@ -209,9 +210,10 @@ class Server(object):
task = endpoint.generate(name=work.task_name)
except Exception:
with misc.capture_failure() as failure:
- LOG.warn("The '%s' task '%s' generation for request"
- " message '%s' failed", endpoint, work.action,
- ku.DelayedPretty(message), exc_info=True)
+ LOG.warning("The '%s' task '%s' generation for request"
+ " message '%s' failed", endpoint,
+ work.action, ku.DelayedPretty(message),
+ exc_info=True)
reply_callback(result=pr.failure_to_dict(failure))
return
else:
@@ -237,9 +239,9 @@ class Server(object):
result = handler(task, **work.arguments)
except Exception:
with misc.capture_failure() as failure:
- LOG.warn("The '%s' endpoint '%s' execution for request"
- " message '%s' failed", endpoint, work.action,
- ku.DelayedPretty(message), exc_info=True)
+ LOG.warning("The '%s' endpoint '%s' execution for request"
+ " message '%s' failed", endpoint, work.action,
+ ku.DelayedPretty(message), exc_info=True)
reply_callback(result=pr.failure_to_dict(failure))
else:
# And be done with it!