From fefab5c90fd5ec263f5b5e19b9088666974a7816 Mon Sep 17 00:00:00 2001 From: Renat Akhmerov Date: Mon, 20 Oct 2014 14:02:36 +0700 Subject: [PATCH] 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 --- mistralclient/commands/v2/cron_triggers.py | 10 ++++++---- mistralclient/commands/v2/executions.py | 2 +- mistralclient/tests/functional/cli/v2/cli_tests_v2.py | 4 ++-- mistralclient/tests/unit/v2/test_cli_cron_triggers.py | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/mistralclient/commands/v2/cron_triggers.py b/mistralclient/commands/v2/cron_triggers.py index 1bfa500b..85fa2553 100644 --- a/mistralclient/commands/v2/cron_triggers.py +++ b/mistralclient/commands/v2/cron_triggers.py @@ -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, ) diff --git a/mistralclient/commands/v2/executions.py b/mistralclient/commands/v2/executions.py index dc535a75..22b8f3d4 100644 --- a/mistralclient/commands/v2/executions.py +++ b/mistralclient/commands/v2/executions.py @@ -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' ) diff --git a/mistralclient/tests/functional/cli/v2/cli_tests_v2.py b/mistralclient/tests/functional/cli/v2/cli_tests_v2.py index 3db1bfb4..b86eb69d 100644 --- a/mistralclient/tests/functional/cli/v2/cli_tests_v2.py +++ b/mistralclient/tests/functional/cli/v2/cli_tests_v2.py @@ -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( diff --git a/mistralclient/tests/unit/v2/test_cli_cron_triggers.py b/mistralclient/tests/unit/v2/test_cli_cron_triggers.py index 7c297bbf..b1a86bad 100644 --- a/mistralclient/tests/unit/v2/test_cli_cron_triggers.py +++ b/mistralclient/tests/unit/v2/test_cli_cron_triggers.py @@ -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] )