From ba21390f487e9f0a26c35f1219b33e641c34ba08 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Wed, 28 May 2014 13:17:16 +1000 Subject: [PATCH] Fix H404 multi line docstring should start without a leading new line Change-Id: Id028ec196dd16696b47614fd77c8adde893dbc56 --- functionaltests/api/base.py | 5 ++--- mistral/engine/__init__.py | 13 ++++--------- mistral/engine/executor.py | 4 +--- mistral/engine/retry.py | 3 +-- mistral/expressions.py | 3 +-- mistral/tests/base.py | 18 +++++++----------- mistral/tests/unit/engine/test_transport.py | 4 ++-- tox.ini | 2 +- 8 files changed, 19 insertions(+), 33 deletions(-) diff --git a/functionaltests/api/base.py b/functionaltests/api/base.py index d2db5ce7b..0eceae144 100644 --- a/functionaltests/api/base.py +++ b/functionaltests/api/base.py @@ -73,9 +73,8 @@ class TestCase(testtools.TestCase): @classmethod def setUpClass(cls): - """ - This method allows to initialize authentication before - each test case and define parameters of Mistral API Service + """This method allows to initialize authentication before + each test case and define parameters of Mistral API Service. """ super(TestCase, cls).setUpClass() diff --git a/mistral/engine/__init__.py b/mistral/engine/__init__.py index 94ddaf9b2..36412f393 100644 --- a/mistral/engine/__init__.py +++ b/mistral/engine/__init__.py @@ -341,8 +341,7 @@ class Engine(object): @classmethod 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. :return: task, outbound_context. task is the updated task and computed outbound context. @@ -367,14 +366,12 @@ class Engine(object): return 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. """ 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 copied over from convey_task_result. """ @@ -414,9 +411,7 @@ class Engine(object): class EngineClient(object): - """ - RPC client for the Engine. - """ + """RPC client for the Engine.""" def __init__(self, transport): """Construct an RPC client for the Engine. diff --git a/mistral/engine/executor.py b/mistral/engine/executor.py index 5e89389cf..a5231bd35 100644 --- a/mistral/engine/executor.py +++ b/mistral/engine/executor.py @@ -49,9 +49,7 @@ class Executor(object): class ExecutorClient(object): - """ - RPC client for the Executor. - """ + """RPC client for the Executor.""" def __init__(self, transport): """Construct an RPC client for the Executor. diff --git a/mistral/engine/retry.py b/mistral/engine/retry.py index 510f8dd39..4d1364e71 100644 --- a/mistral/engine/retry.py +++ b/mistral/engine/retry.py @@ -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, 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 task into consideration. diff --git a/mistral/expressions.py b/mistral/expressions.py index b9875dc51..ad4d1e9bc 100644 --- a/mistral/expressions.py +++ b/mistral/expressions.py @@ -45,8 +45,7 @@ class Evaluator(object): @classmethod @abc.abstractmethod 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 :return: True if string is expression diff --git a/mistral/tests/base.py b/mistral/tests/base.py index 1469fb950..d9f775e90 100644 --- a/mistral/tests/base.py +++ b/mistral/tests/base.py @@ -129,8 +129,7 @@ class EngineTestCase(DbTestCase): @classmethod def mock_task_result(cls, workbook_name, execution_id, 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. """ cntx = {} @@ -143,8 +142,7 @@ class EngineTestCase(DbTestCase): @classmethod 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. """ cntx = {} @@ -155,9 +153,9 @@ class EngineTestCase(DbTestCase): @classmethod def mock_get_workflow_state(cls, workbook_name, execution_id): - """ - Mock the engine get_workflow_execution_state to send request directly - to the engine instead of going through the oslo.messaging transport. + """Mock the engine get_workflow_execution_state to send request + directly to the engine instead of going through the oslo.messaging + transport. """ cntx = {} kwargs = {'workbook_name': workbook_name, @@ -166,8 +164,7 @@ class EngineTestCase(DbTestCase): @classmethod 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. """ exctr = executor.get_executor(cfg.CONF.engine.engine, cls.transport) @@ -176,8 +173,7 @@ class EngineTestCase(DbTestCase): @classmethod 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. """ exctr = executor.get_executor(cfg.CONF.engine.engine, cls.transport) diff --git a/mistral/tests/unit/engine/test_transport.py b/mistral/tests/unit/engine/test_transport.py index 2912ce752..91605b355 100644 --- a/mistral/tests/unit/engine/test_transport.py +++ b/mistral/tests/unit/engine/test_transport.py @@ -64,8 +64,8 @@ class TestTransport(base.EngineTestCase): @mock.patch.object( std_actions.HTTPAction, 'run', mock.MagicMock(return_value={})) def test_transport(self): - """ - Test if engine request traversed through the oslo.messaging transport. + """Test if engine request traversed through the oslo.messaging + transport. """ execution = self.engine.start_workflow_execution( WB_NAME, 'create-vms', CONTEXT) diff --git a/tox.ini b/tox.ini index 52ed3f4ab..ca576c5cd 100644 --- a/tox.ini +++ b/tox.ini @@ -38,6 +38,6 @@ commands = bash tools/lintstack.sh [flake8] show-source = true -ignore = H101,H302,H306,H404,H803 +ignore = H101,H302,H306,H803 builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools