* Add creating keystone auth_token in context
when task is scheduled for execution. Auth token
is created from workbook trust_id in case Auth_enable
* Added transforming values of task_spec and service_spec
with YAQL and context.
* This feature affects some unit tests, so they are fixed
* Added unit tests
Partially implements: blueprint mistral-dataflow
Change-Id: I15794da427bfc7babbc4e3d58a90200c10a19a72
* keystone_authtoken is renamed to keystone due to
unexisting name. It isn't able to create workbook
with auth_enable=True without this fix
Change-Id: I3d865e31b87dbb18e62ee3d6fa4ca5054ff5c8fd
* When parsing yaml we can't rely on order of properties
because it's against yaml specification
* In tests we often make assumptions about list items order
Change-Id: I536bc31ba7bee68e2904a23af73004f2e0ba2261
* Executor launch script should now start engine because
it calls engine.convey_task_result() directly. It's a
temporary solution until engine is a standalone process.
When it's done executor will be sending a message back to
engine instead of making a local call.
Change-Id: I4666ca5f1a9cb093e8b7c9e640048f0176955595
* "events" are renamed to "triggers"
* triggers moved out of workflow section
Implements: blueprint mistral-rename-event-to-trigger
Change-Id: I5b76e9c063a3ce9eec5d485bb5db5e22ac7981d4
* Implemented new object model
* Implemented spec validation
* Old DSL parser was deleted
* All code is replaced by new workbook spec
* Also tests are fixed
* events -> triggers
* Unit tests
Implements: blueprint mistral-dsl-model
Partially implements: blueprint mistral-dsl-validation
Partially implements: blueprint mistral-rename-event-to-trigger
Change-Id: I782b7983ddc724375229587f467c55ad9341478b
Ported task executor to oslo.messaging. The executor module is
replaced with RPC server/client named Executor and ExecutorClient
respectively to handle task execution. The old executor module is
deleted. The engine is modified to use the ExecutorClient to send
task requests over the transport to the Executor. The launcher is
modified to start the new Executor.
Change-Id: Ibce01813e51c2220c45e05bb820b4729027446a3
Implements: blueprint mistral-oslo-messaging
* Refactored tests hierarcy (moved get_resource to the base class)
* Fixed logic in abstract engine (transaction scoope was wrong)
* Added stub methods for context manipulations (not everywhere yet)
* Refactored actions
* Created ECHO action to be able to emulate required output
* Added simple data flow test (two dependent tasks)
TODO:
* More tests
* Refactor actions according to the latest discussions
Change-Id: I5ba5e330110889014eeca53501ddae54dc9a1236
To make it easy to set Mistral for debugging.
1) Make engine configurable.
2) Enable debugger via command line. Passing --use-debugger will make PyDev or PyCharm show
local variables in debugging session.
Also, a tiny fix in action_factory.
Change-Id: Id054ae5156649b1f6bbba7131e54bf21d71c659a
Fixed several errors:
E1003
E1101
It is impossible to fix all E1101 errors: looks like we have
problems with outdated DataBase models.
Change-Id: I46863c553f033e5f9e4ae9cb9c20e297c099a114
Partial-Fixes: bug #1281164
* Deleted exception when 'output' block in REST_API task
is not defined. In this case result is the whole object
returned from extract_state_result
Fixes bug: #1280117
Change-Id: I8143283133994d39e34e9c82493b2cff67fa0d59
* Added ExpressionEvaluator interface and YAQL implementation
* Removed yaql_utils, evaluator is now a more flexible replacement
* Fixed the places where yaql_utils was used
* Adjusted test cases
Change-Id: I7de70e678c211df34788763047b8361de0d3902a
* Refactored API layer so that we can work with 'context' as with a
json object in underlying layers (DB, engine, etc.) rather than
a string
* Added "context" parameter in all required places
* Added necessary Data Flow related properties to DB models
* Refactored and fixed a series of tests
* Minor formatting changes
TODO:
* Calculation of task incoming context
* Abstract interface for expression evaluator
* Data Flow related tests
Partially implements blueprint: mistral-dataflow
Change-Id: Ie7f94d79265e9861f7ad15c76ff6d788ec62b683
* Fix get task properties, get task in DSL
* Evaluating task on success/error/finish properties in engine:
- evaluate YAQL conditions
- schedule tasks
* Unit tests for handling success/error/finish
* For real work with context there is need to store
it somewhere
Implements: blueprint schedule-tasks-after-completion
Change-Id: Ia9c34e755055ff0273dcd79a314858dbfbcc2fa9
Added send_email to action types and action factory.
Now it works end-to-end.
NOTE:this renames DSL from action.parameters.responce
to action.output. Other projects will need to adjust.
Tested manually with mistral-extra/examples/webhooks/cmd/run.py,
It works, almost: except a bug causing exception on parsing out results.
In discussion, but a fix should go in separate commit.
Also, small fixes:
action_factory:31 - used to blow up when action has no 'parameters'
dsl.py:32 - return details on parsing errors (error, line, column)
api/config.py - deleted: not used
Change-Id: Ie7079eb9589c23cc6704f8e8739af67a635f1c77
Basic send-email functionality and unit tests
See comments in test_send_email_action on how to run with real smtpd.
Implements: blueprint mistral-std-send-email-action
Change-Id: Ib1d460d26ce54f4ab85d34b18947d858ab471dfd
1. Add couple of negative tests, find the way, more to go.
2. Add assertNotFound to the base test class for convenience.
3. MistralException - added default message to enable default instantiation - make mock.assertRaise fails when exception has no default constructor
Change-Id: I708637e3995597a819571a90f3292d6e34deab4e
* For HTTP GET task input is converted to request url parameters
* For HTTP POST/PUT - into request body
Change-Id: Ibc863ffb99ffdd0099f9ba2f43178e02dc1dd0c2
* Non-Mistral actions gets a JSON response
from which result can be extracted with
YAQL-expression
* Unit test
* Feature is added to both engines
Change-Id: Iae6aa031e6b5700b3a08ee184f5eae291458a8c4
* Moved pecan configuration to oslo config
* Refactored functional base test
* Got rig of thread local related code in mistral/context.py
* Added new exception ApplicationContextNotFoundException
* Fixed example configuration file
* Made minor cosmetic changes (blank lines, naming)
Change-Id: I1899ce2562a34ebafa20c5735bdf4f0c80dd0175