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', 'Name',
'Pattern', 'Pattern',
'Workflow', 'Workflow',
'Workflow input', # TODO (rakhmerov): Uncomment when passwords are handled properly.
# 'Workflow input',
'Next execution time', 'Next execution time',
'Created at', 'Created at',
'Updated at' 'Updated at'
) )
if trigger: if trigger:
wf_input = trigger.workflow_input if not lister \ # wf_input = trigger.workflow_input if not lister \
else base.cut(trigger.workflow_input) # else base.cut(trigger.workflow_input)
data = ( data = (
trigger.name, trigger.name,
trigger.pattern, trigger.pattern,
trigger.workflow_name, trigger.workflow_name,
wf_input, # TODO (rakhmerov): Uncomment when passwords are handled properly.
# wf_input,
trigger.next_execution_time, trigger.next_execution_time,
trigger.created_at, trigger.created_at,
) )

View File

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

View File

@@ -253,13 +253,13 @@ class ExecutionCLITests(ClientTestBase):
self.assertEqual('RUNNING', status) self.assertEqual('RUNNING', status)
execution = self.mistral_command( 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') updated_exec_id = self.get_value_of_field(execution, 'ID')
status = self.get_value_of_field(execution, 'State') status = self.get_value_of_field(execution, 'State')
self.assertEqual(exec_id, updated_exec_id) self.assertEqual(exec_id, updated_exec_id)
self.assertEqual('STOPPED', status) self.assertEqual('PAUSED', status)
def test_execution_get(self): def test_execution_get(self):
execution = self.mistral_command( execution = self.mistral_command(

View File

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