Merge "Fixing indentation in 'create action' tutorial"

This commit is contained in:
Jenkins 2015-09-17 12:36:27 +00:00 committed by Gerrit Code Review
commit 09df1f7079

View File

@ -1,8 +1,10 @@
=============================
How to write an Action Plugin How to write an Action Plugin
============================= =============================
1. Write a class inherited from mistral.actions.base.Action 1. Write a class inherited from mistral.actions.base.Action
::
.. code-block:: python
from mistral.actions import base from mistral.actions import base
@ -15,34 +17,37 @@ How to write an Action Plugin
# return your results here # return your results here
return {'status': 0} return {'status': 0}
2. Publish the class in a namespace
(in your setup.cfg)
:: 2. Publish the class in a namespace (in your ``setup.cfg``)
.. code-block:: ini
[entry_points] [entry_points]
mistral.actions = mistral.actions =
example.runner = my.mistral_plugins.somefile:RunnerAction example.runner = my.mistral_plugins.somefile:RunnerAction
3. Reinstall Mistral if it was installed in system (not in virtualenv). 3. Reinstall Mistral if it was installed in system (not in virtualenv).
4. Run Db-sync tool via either::
*tools/sync_db.sh --config-file <path-to-config>* 4. Run db-sync tool via either
or:: .. code-block:: console
*mistral-db-manage --config-file <path-to-config> populate* $ tools/sync_db.sh --config-file <path-to-config>
5. Use your plugin or
* Now you can call the action "example.runner" .. code-block:: console
:: $ mistral-db-manage --config-file <path-to-config> populate
Workflow: 5. Now you can call the action ``example.runner``
.. code-block:: yaml
my_workflow:
tasks: tasks:
myaction: my_action_task:
action: example.runner action: example.runner
parameters: input:
param: avalue_to_pass_in param: avalue_to_pass_in