Add 'created_at' to execution() yaql function

Sometimes, an action needs to know the time passed since the whole
workflow started.

Change-Id: Id347e4cf2489f29dad7d16237d526660ee11665e
This commit is contained in:
Lingxian Kong 2017-03-23 14:30:44 +13:00
parent 9d98e1ab9b
commit d7e5c213bb
2 changed files with 7 additions and 1 deletions

View File

@ -313,3 +313,8 @@ class YAQLFunctionsEngineTest(engine_test_base.EngineTestCase):
)
self.assertDictEqual({'param1': 'blablabla'}, execution['params'])
self.assertEqual(
wf_ex.created_at.isoformat(' '),
execution['created_at']
)

View File

@ -108,7 +108,8 @@ def execution_(context):
'name': wf_ex.name,
'spec': wf_ex.spec,
'input': wf_ex.input,
'params': wf_ex.params
'params': wf_ex.params,
'created_at': wf_ex.created_at.isoformat(' ')
}