From fce7afbd8db26180816abe7d9566cf65277de376 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Wed, 17 Dec 2014 16:42:21 -0800 Subject: [PATCH] Remove less than useful action_engine __str__ The implementation of __str__ does not provide much useful information so instead just prefer the automatically provided one which provides equivalent information in a more well known format... Change-Id: I0a1683cfc22df1888a19f5af10d7a343462d3994 --- doc/source/notifications.rst | 12 ++++++------ taskflow/engines/action_engine/engine.py | 4 ---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/doc/source/notifications.rst b/doc/source/notifications.rst index 118b5aab..13c550ee 100644 --- a/doc/source/notifications.rst +++ b/doc/source/notifications.rst @@ -136,14 +136,14 @@ For example, this is how you can use >>> with printing.PrintingListener(eng): ... eng.run() ... - taskflow.engines.action_engine.engine.SerialActionEngine: ... has moved flow 'cat-dog' (...) into state 'RUNNING' - taskflow.engines.action_engine.engine.SerialActionEngine: ... has moved task 'CatTalk' (...) into state 'RUNNING' + has moved flow 'cat-dog' (...) into state 'RUNNING' + has moved task 'CatTalk' (...) into state 'RUNNING' meow - taskflow.engines.action_engine.engine.SerialActionEngine: ... has moved task 'CatTalk' (...) into state 'SUCCESS' with result 'cat' (failure=False) - taskflow.engines.action_engine.engine.SerialActionEngine: ... has moved task 'DogTalk' (...) into state 'RUNNING' + has moved task 'CatTalk' (...) into state 'SUCCESS' with result 'cat' (failure=False) + has moved task 'DogTalk' (...) into state 'RUNNING' woof - taskflow.engines.action_engine.engine.SerialActionEngine: ... has moved task 'DogTalk' (...) into state 'SUCCESS' with result 'dog' (failure=False) - taskflow.engines.action_engine.engine.SerialActionEngine: ... has moved flow 'cat-dog' (...) into state 'SUCCESS' + has moved task 'DogTalk' (...) into state 'SUCCESS' with result 'dog' (failure=False) + has moved flow 'cat-dog' (...) into state 'SUCCESS' Basic listener -------------- diff --git a/taskflow/engines/action_engine/engine.py b/taskflow/engines/action_engine/engine.py index f4158850..b0dbaa3a 100644 --- a/taskflow/engines/action_engine/engine.py +++ b/taskflow/engines/action_engine/engine.py @@ -20,7 +20,6 @@ import threading from concurrent import futures from oslo.utils import excutils -from oslo.utils import reflection from taskflow.engines.action_engine import compiler from taskflow.engines.action_engine import executor @@ -70,9 +69,6 @@ class ActionEngine(base.Engine): self._state_lock = threading.RLock() self._storage_ensured = False - def __str__(self): - return "%s: %s" % (reflection.get_class_name(self), id(self)) - def suspend(self): if not self._compiled: raise exc.InvalidState("Can not suspend an engine"