Merge "Remove direct usage of the deprecated notifier location"
This commit is contained in:
@@ -19,6 +19,7 @@ import abc
|
||||
|
||||
import six
|
||||
|
||||
from taskflow.types import notifier
|
||||
from taskflow.utils import misc
|
||||
|
||||
|
||||
@@ -40,8 +41,8 @@ class EngineBase(object):
|
||||
self._options = {}
|
||||
else:
|
||||
self._options = dict(options)
|
||||
self.notifier = misc.Notifier()
|
||||
self.task_notifier = misc.Notifier()
|
||||
self.notifier = notifier.Notifier()
|
||||
self.task_notifier = notifier.Notifier()
|
||||
|
||||
@property
|
||||
def options(self):
|
||||
|
||||
@@ -39,14 +39,14 @@ from taskflow.listeners import base
|
||||
from taskflow.patterns import linear_flow as lf
|
||||
from taskflow import states
|
||||
from taskflow import task
|
||||
from taskflow.utils import misc
|
||||
from taskflow.types import notifier
|
||||
|
||||
|
||||
class PokeFutureListener(base.ListenerBase):
|
||||
def __init__(self, engine, future, task_name):
|
||||
super(PokeFutureListener, self).__init__(
|
||||
engine,
|
||||
task_listen_for=(misc.Notifier.ANY,),
|
||||
task_listen_for=(notifier.Notifier.ANY,),
|
||||
flow_listen_for=[])
|
||||
self._future = future
|
||||
self._task_name = task_name
|
||||
|
||||
@@ -19,7 +19,7 @@ import abc
|
||||
|
||||
import six
|
||||
|
||||
from taskflow.utils import misc
|
||||
from taskflow.types import notifier
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
@@ -203,4 +203,4 @@ class NotifyingJobBoard(JobBoard):
|
||||
"""
|
||||
def __init__(self, name, conf):
|
||||
super(NotifyingJobBoard, self).__init__(name, conf)
|
||||
self.notifier = misc.Notifier()
|
||||
self.notifier = notifier.Notifier()
|
||||
|
||||
@@ -23,6 +23,7 @@ from oslo.utils import excutils
|
||||
import six
|
||||
|
||||
from taskflow import states
|
||||
from taskflow.types import notifier
|
||||
from taskflow.utils import misc
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@@ -46,8 +47,8 @@ class ListenerBase(object):
|
||||
"""
|
||||
|
||||
def __init__(self, engine,
|
||||
task_listen_for=(misc.Notifier.ANY,),
|
||||
flow_listen_for=(misc.Notifier.ANY,)):
|
||||
task_listen_for=(notifier.Notifier.ANY,),
|
||||
flow_listen_for=(notifier.Notifier.ANY,)):
|
||||
if not task_listen_for:
|
||||
task_listen_for = []
|
||||
if not flow_listen_for:
|
||||
|
||||
@@ -21,6 +21,7 @@ import sys
|
||||
|
||||
from taskflow.listeners import base
|
||||
from taskflow import states
|
||||
from taskflow.types import notifier
|
||||
from taskflow.utils import misc
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@@ -51,8 +52,8 @@ class LoggingListener(base.LoggingBase):
|
||||
is provided.
|
||||
"""
|
||||
def __init__(self, engine,
|
||||
task_listen_for=(misc.Notifier.ANY,),
|
||||
flow_listen_for=(misc.Notifier.ANY,),
|
||||
task_listen_for=(notifier.Notifier.ANY,),
|
||||
flow_listen_for=(notifier.Notifier.ANY,),
|
||||
log=None,
|
||||
level=logging.DEBUG):
|
||||
super(LoggingListener, self).__init__(engine,
|
||||
@@ -99,8 +100,8 @@ class DynamicLoggingListener(base.ListenerBase):
|
||||
"""
|
||||
|
||||
def __init__(self, engine,
|
||||
task_listen_for=(misc.Notifier.ANY,),
|
||||
flow_listen_for=(misc.Notifier.ANY,),
|
||||
task_listen_for=(notifier.Notifier.ANY,),
|
||||
flow_listen_for=(notifier.Notifier.ANY,),
|
||||
log=None, failure_level=logging.WARNING,
|
||||
level=logging.DEBUG):
|
||||
super(DynamicLoggingListener, self).__init__(
|
||||
|
||||
@@ -20,14 +20,14 @@ import sys
|
||||
import traceback
|
||||
|
||||
from taskflow.listeners import base
|
||||
from taskflow.utils import misc
|
||||
from taskflow.types import notifier
|
||||
|
||||
|
||||
class PrintingListener(base.LoggingBase):
|
||||
"""Writes the task and flow notifications messages to stdout or stderr."""
|
||||
def __init__(self, engine,
|
||||
task_listen_for=(misc.Notifier.ANY,),
|
||||
flow_listen_for=(misc.Notifier.ANY,),
|
||||
task_listen_for=(notifier.Notifier.ANY,),
|
||||
flow_listen_for=(notifier.Notifier.ANY,),
|
||||
stderr=False):
|
||||
super(PrintingListener, self).__init__(engine,
|
||||
task_listen_for=task_listen_for,
|
||||
|
||||
@@ -27,7 +27,7 @@ from taskflow import storage
|
||||
from taskflow import test
|
||||
from taskflow.tests import utils as test_utils
|
||||
from taskflow.types import fsm
|
||||
from taskflow.utils import misc
|
||||
from taskflow.types import notifier
|
||||
from taskflow.utils import persistence_utils as pu
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class _RunnerTestMixin(object):
|
||||
store.ensure_atom(task)
|
||||
if initial_state:
|
||||
store.set_flow_state(initial_state)
|
||||
task_notifier = misc.Notifier()
|
||||
task_notifier = notifier.Notifier()
|
||||
task_executor = executor.SerialTaskExecutor()
|
||||
task_executor.start()
|
||||
self.addCleanup(task_executor.stop)
|
||||
|
||||
@@ -428,4 +428,4 @@ def capture_failure():
|
||||
if not any(exc_info):
|
||||
raise RuntimeError("No active exception is being handled")
|
||||
else:
|
||||
yield Failure(exc_info=exc_info)
|
||||
yield failure.Failure(exc_info=exc_info)
|
||||
|
||||
Reference in New Issue
Block a user