Merge "Fix H404 multi line docstring should start without a leading new line"

This commit is contained in:
Jenkins 2014-05-29 04:04:15 +00:00 committed by Gerrit Code Review
commit 972999f81d
8 changed files with 19 additions and 33 deletions

View File

@ -73,9 +73,8 @@ class TestCase(testtools.TestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
""" """This method allows to initialize authentication before
This method allows to initialize authentication before each test case and define parameters of Mistral API Service.
each test case and define parameters of Mistral API Service
""" """
super(TestCase, cls).setUpClass() super(TestCase, cls).setUpClass()

View File

@ -341,8 +341,7 @@ class Engine(object):
@classmethod @classmethod
def _update_task(cls, workbook, task, state, task_output): def _update_task(cls, workbook, task, state, task_output):
""" """Update the task with the runtime information. The outbound_context
Update the task with the runtime information. The outbound_context
for this task is also calculated. for this task is also calculated.
:return: task, outbound_context. task is the updated task and :return: task, outbound_context. task is the updated task and
computed outbound context. computed outbound context.
@ -367,14 +366,12 @@ class Engine(object):
return task, outbound_context return task, outbound_context
def _schedule_run(cls, workbook, task, outbound_context): def _schedule_run(cls, workbook, task, outbound_context):
""" """Schedules task to run after the delay defined in the task
Schedules task to run after the delay defined in the task
specification. If no delay is specified this method is a no-op. specification. If no delay is specified this method is a no-op.
""" """
def run_delayed_task(): def run_delayed_task():
""" """Runs the delayed task. Performs all the steps required to setup
Runs the delayed task. Performs all the steps required to setup
a task to run which are not already done. This is mostly code a task to run which are not already done. This is mostly code
copied over from convey_task_result. copied over from convey_task_result.
""" """
@ -414,9 +411,7 @@ class Engine(object):
class EngineClient(object): class EngineClient(object):
""" """RPC client for the Engine."""
RPC client for the Engine.
"""
def __init__(self, transport): def __init__(self, transport):
"""Construct an RPC client for the Engine. """Construct an RPC client for the Engine.

View File

@ -49,9 +49,7 @@ class Executor(object):
class ExecutorClient(object): class ExecutorClient(object):
""" """RPC client for the Executor."""
RPC client for the Executor.
"""
def __init__(self, transport): def __init__(self, transport):
"""Construct an RPC client for the Executor. """Construct an RPC client for the Executor.

View File

@ -26,8 +26,7 @@ WORKFLOW_TRACE = logging.getLogger(cfg.CONF.workflow_trace_log_name)
def get_task_runtime(task_spec, state=states.IDLE, outbound_context=None, def get_task_runtime(task_spec, state=states.IDLE, outbound_context=None,
task_runtime_context=None): task_runtime_context=None):
""" """Computes the state and exec_flow_context runtime properties for a task
Computes the state and exec_flow_context runtime properties for a task
based on the supplied properties. This method takes the retry nature of a based on the supplied properties. This method takes the retry nature of a
task into consideration. task into consideration.

View File

@ -45,8 +45,7 @@ class Evaluator(object):
@classmethod @classmethod
@abc.abstractmethod @abc.abstractmethod
def is_expression(cls, expression): def is_expression(cls, expression):
""" """Check expression string and decide whether it is expression or not.
Check expression string and decide whether it is expression or not.
:param expression: Expression string :param expression: Expression string
:return: True if string is expression :return: True if string is expression

View File

@ -129,8 +129,7 @@ class EngineTestCase(DbTestCase):
@classmethod @classmethod
def mock_task_result(cls, workbook_name, execution_id, def mock_task_result(cls, workbook_name, execution_id,
task_id, state, result): task_id, state, result):
""" """Mock the engine convey_task_results to send request directly
Mock the engine convey_task_results to send request directly
to the engine instead of going through the oslo.messaging transport. to the engine instead of going through the oslo.messaging transport.
""" """
cntx = {} cntx = {}
@ -143,8 +142,7 @@ class EngineTestCase(DbTestCase):
@classmethod @classmethod
def mock_start_workflow(cls, workbook_name, task_name, context=None): def mock_start_workflow(cls, workbook_name, task_name, context=None):
""" """Mock the engine start_workflow_execution to send request directly
Mock the engine start_workflow_execution to send request directly
to the engine instead of going through the oslo.messaging transport. to the engine instead of going through the oslo.messaging transport.
""" """
cntx = {} cntx = {}
@ -155,9 +153,9 @@ class EngineTestCase(DbTestCase):
@classmethod @classmethod
def mock_get_workflow_state(cls, workbook_name, execution_id): def mock_get_workflow_state(cls, workbook_name, execution_id):
""" """Mock the engine get_workflow_execution_state to send request
Mock the engine get_workflow_execution_state to send request directly directly to the engine instead of going through the oslo.messaging
to the engine instead of going through the oslo.messaging transport. transport.
""" """
cntx = {} cntx = {}
kwargs = {'workbook_name': workbook_name, kwargs = {'workbook_name': workbook_name,
@ -166,8 +164,7 @@ class EngineTestCase(DbTestCase):
@classmethod @classmethod
def mock_run_tasks(cls, tasks): def mock_run_tasks(cls, tasks):
""" """Mock the engine _run_tasks to send requests directly to the task
Mock the engine _run_tasks to send requests directly to the task
executor instead of going through the oslo.messaging transport. executor instead of going through the oslo.messaging transport.
""" """
exctr = executor.get_executor(cfg.CONF.engine.engine, cls.transport) exctr = executor.get_executor(cfg.CONF.engine.engine, cls.transport)
@ -176,8 +173,7 @@ class EngineTestCase(DbTestCase):
@classmethod @classmethod
def mock_handle_task(cls, cntx, **kwargs): def mock_handle_task(cls, cntx, **kwargs):
""" """Mock the executor handle_task to send requests directory to the task
Mock the executor handle_task to send requests directory to the task
executor instead of going through the oslo.messaging transport. executor instead of going through the oslo.messaging transport.
""" """
exctr = executor.get_executor(cfg.CONF.engine.engine, cls.transport) exctr = executor.get_executor(cfg.CONF.engine.engine, cls.transport)

View File

@ -64,8 +64,8 @@ class TestTransport(base.EngineTestCase):
@mock.patch.object( @mock.patch.object(
std_actions.HTTPAction, 'run', mock.MagicMock(return_value={})) std_actions.HTTPAction, 'run', mock.MagicMock(return_value={}))
def test_transport(self): def test_transport(self):
""" """Test if engine request traversed through the oslo.messaging
Test if engine request traversed through the oslo.messaging transport. transport.
""" """
execution = self.engine.start_workflow_execution( execution = self.engine.start_workflow_execution(
WB_NAME, 'create-vms', CONTEXT) WB_NAME, 'create-vms', CONTEXT)

View File

@ -38,6 +38,6 @@ commands = bash tools/lintstack.sh
[flake8] [flake8]
show-source = true show-source = true
ignore = H101,H302,H306,H404,H803 ignore = H101,H302,H306,H803
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools