TrivialFix: Similar [1] in Kolla project
As we known, Exceptions are raised by the sys.exit() function. When they
are not handled, no stack traceback is printed in the Python interpreter.
Therefore, when using sys.exit(main()) instead of main()
may be more readable and reasonable.
[1] https://review.openstack.org/#/c/349353/
Change-Id: Ic71d4bfb1085c68ea9eb7e1382e7263a81634ad1
* This script allows generating helpstrings
of all mistralclient commands and adopt them
to rst format.
* This script is just POC and requires a further
manual editing in order to make the document
more clear.
Change-Id: If5f9144a254ef0b97c17e66638641e1052cc08d1
Currently the only Javascript implentation supported by the
std.javascript action is PyV8, a project that has been abandoned
for about two years and can only be compiled with an outdated
version of V8, one affected by several security vulnerabilities.
This change adds support for v8eval, a more recent interface to V8
that is still being maintained.
Change-Id: Id9cb89ffb05b37ef525a6085d49229de63420bbf
* 'in_context' field of task executions changed its semantics to
not store workflow input and other data stored in the initial
workflow context such as openstack security context and workflow
variables, therefore task executions occupy less space in DB
* Introduced ContextView class to avoid having to merge
dictionaries every time we need to evaluate YAQL functions
against some context. This class is a composite structure
built on top of regular dictionaries that provides priority
based lookup algorithm over these dictionaries. For example,
if we need to evaluate an expression against a task inbound
context we just need to build a context view including
task 'in_context', workflow initial context (wf_ex.context)
and workflow input dictionary (wf_ex.input). Using this
class is a significant performance boost
* Fixed unit tests
* Other minor changes
Change-Id: I7fe90533e260e7d78818b69a087fb5175b9d5199
Replace assertEqual(None, *) with assertIsNone in tests to
have more clear messages in case of failure.
Change-Id: Ida4c8a8159b2ebc2826646052f5ca4dbc8229575
In Python 3 __ne__ by default delegates to __eq__ and inverts the
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining __eq__(),
one should also define __ne__() so that the operators will behave
as expected.
[1]https://docs.python.org/2/reference/datamodel.html#object.__ne__
Change-Id: I4c1b630d14030c9e451e58342b0d44e2058fa51f
The current documentation states that one is required. However, this is not
enforced in the code and in mistral/workbook/v2/tasks.py if neither are
provided then the `std.noop` action is used instead.
Closes-Bug: #1624012
Change-Id: I5f5a39bad3e671741bc9fd1b142df9aef0b87a36
Abstract authentication function so plugins for other authentication
backends can be implemented in cases where keystone is not used. Currently,
mistral is hard coded to support keystone and keycloak. The domain/project
related trust that is specific to keystone is not addressed.
Change-Id: I21994ab20af519b2ba85efd7cbe043547988e5b3
Implements: blueprint mistral-abstract-auth
* The reason to remove workflow spec and input is optimizing
DB space taken by task execution objects, now they are very
heavy if case of large workflows because their inbound contexts
always contain a full workflow specification
* execution() YAQL function now doesn't take values from task
context, it just does a simple DB lookup
Change-Id: I00b88d4ca75f334ebce764332c21aef96eba5414
* Moved DB related lookup functions from workflow/utils to
a separate module lookup_utils
* Optimized data access pattern where we calculate 'join'
states induced by upstream tasks, applied caching for some
lookup operations
* Added caching in direct workflow specification for inbound
and outbound task specs, if workflow size is large calculating
them may be expensive
* Added an adaptive delay between calls that refresh 'join'
task state based on a number of unfulfilled preconditions
returned by workflow controller
Change-Id: I383fa52f2f05877df7522048020cc7ff280324a2
* When we start a workflow we don't need to reparse a workflow
specification if we request it by workflow execution id for the
first time. Instead, we can just update workflow execution
specification cache with the value from workflow definition
specification cache. For large workflows, it significantly
reduces time of workflow start.
Change-Id: Ibe4c788040996e3f119c96cb130fdc95d46286d9
This test class doesn't fully test event engine functions, because
we can not send real notifications to the internal message queue to
trigger the specified workflows.
So, before notification is supported in Mistral, we can only test the API
functions.
Change-Id: I4289dac17f19cd2ce3c214c5625f3b7d9db605de
Implements: blueprint event-notification-trigger
Task's in_bound context was updated incorrectly.
When task with retrying policy is retrying second time
it cannot get previously published variables.
Change-Id: Ia909a314bcf6a4fc2dc873baec82c11f8555811c