Fix execution state choices and commenting workflow input in triggers

* We'll need to uncomment workflow input column in cron triggers
  when passwords are handled properly

Change-Id: I098e5d8240bb0504d8f850d5a0067989bbe8dc5c
This commit is contained in:
Renat Akhmerov
2014-10-20 14:02:36 +07:00
parent 7caffe9409
commit fefab5c90f
4 changed files with 12 additions and 10 deletions

View File

@@ -35,21 +35,23 @@ def format(trigger=None, lister=False):
'Name',
'Pattern',
'Workflow',
'Workflow input',
# TODO (rakhmerov): Uncomment when passwords are handled properly.
# 'Workflow input',
'Next execution time',
'Created at',
'Updated at'
)
if trigger:
wf_input = trigger.workflow_input if not lister \
else base.cut(trigger.workflow_input)
# wf_input = trigger.workflow_input if not lister \
# else base.cut(trigger.workflow_input)
data = (
trigger.name,
trigger.pattern,
trigger.workflow_name,
wf_input,
# TODO (rakhmerov): Uncomment when passwords are handled properly.
# wf_input,
trigger.next_execution_time,
trigger.created_at,
)

View File

@@ -151,7 +151,7 @@ class Update(show.ShowOne):
)
parser.add_argument(
'state',
choices=['RUNNING', 'SUSPENDED', 'STOPPED', 'SUCCESS', 'ERROR'],
choices=['RUNNING', 'PAUSED', 'SUCCESS', 'ERROR'],
help='Execution state'
)

View File

@@ -253,13 +253,13 @@ class ExecutionCLITests(ClientTestBase):
self.assertEqual('RUNNING', status)
execution = self.mistral_command(
'execution-update', params='{0} "STOPPED"'.format(exec_id))
'execution-update', params='{0} "PAUSED"'.format(exec_id))
updated_exec_id = self.get_value_of_field(execution, 'ID')
status = self.get_value_of_field(execution, 'State')
self.assertEqual(exec_id, updated_exec_id)
self.assertEqual('STOPPED', status)
self.assertEqual('PAUSED', status)
def test_execution_get(self):
execution = self.mistral_command(

View File

@@ -49,7 +49,7 @@ class TestCLIWorkbooksV2(base.BaseCommandTest):
)
self.assertEqual(
('my_trigger', '* * * * *', 'flow1', {}, '1', '1', '1'),
('my_trigger', '* * * * *', 'flow1', '1', '1', '1'),
result[1]
)
@@ -60,7 +60,7 @@ class TestCLIWorkbooksV2(base.BaseCommandTest):
result = self.call(cron_triggers_cmd.List)
self.assertEqual(
[('my_trigger', '* * * * *', 'flow1', {}, '1', '1', '1')],
[('my_trigger', '* * * * *', 'flow1', '1', '1', '1')],
result[1]
)
@@ -71,7 +71,7 @@ class TestCLIWorkbooksV2(base.BaseCommandTest):
result = self.call(cron_triggers_cmd.Get, app_args=['name'])
self.assertEqual(
('my_trigger', '* * * * *', 'flow1', {}, '1', '1', '1'),
('my_trigger', '* * * * *', 'flow1', '1', '1', '1'),
result[1]
)