diff --git a/debian/changelog b/debian/changelog index e14e034..d93ebe4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ -python-mistralclient (1:2.1.1-3) UNRELEASED; urgency=medium +python-mistralclient (1:2.1.2-1) unstable; urgency=medium + * Team upload. + * New upstream release * Bumped debhelper compat version to 10 - -- Ondřej Nový Thu, 24 Nov 2016 00:07:38 +0100 + -- Ondřej Nový Wed, 28 Dec 2016 23:24:09 +0100 python-mistralclient (1:2.1.1-2) unstable; urgency=medium diff --git a/mistralclient/api/httpclient.py b/mistralclient/api/httpclient.py index 411a93e..f04598f 100644 --- a/mistralclient/api/httpclient.py +++ b/mistralclient/api/httpclient.py @@ -128,7 +128,8 @@ class HTTPClient(object): if target_auth_uri: headers['X-Target-Auth-Uri'] = target_auth_uri - # Add headers for osprofiler. - headers.update(osprofiler_web.get_trace_id_headers()) + if osprofiler_web: + # Add headers for osprofiler. + headers.update(osprofiler_web.get_trace_id_headers()) return headers diff --git a/mistralclient/commands/v2/action_executions.py b/mistralclient/commands/v2/action_executions.py index e45cb19..0fef369 100644 --- a/mistralclient/commands/v2/action_executions.py +++ b/mistralclient/commands/v2/action_executions.py @@ -113,6 +113,12 @@ class Create(command.ShowOne): action='store_true', help='Save the result into DB.' ) + parser.add_argument( + '--run-sync', + dest='run_sync', + action='store_true', + help='Run the action synchronously.' + ) parser.add_argument( '-t', '--target', @@ -128,6 +134,9 @@ class Create(command.ShowOne): if parsed_args.save_result: params['save_result'] = parsed_args.save_result + if parsed_args.run_sync: + params['run_sync'] = parsed_args.run_sync + if parsed_args.target: params['target'] = parsed_args.target @@ -146,7 +155,7 @@ class Create(command.ShowOne): **params ) - if parsed_args.save_result: + if not parsed_args.run_sync and parsed_args.save_result: return format(action_ex) else: self.app.stdout.write("%s\n" % action_ex.output) diff --git a/mistralclient/tests/unit/v2/test_cli_action_execs.py b/mistralclient/tests/unit/v2/test_cli_action_execs.py index 6872f03..41a3910 100644 --- a/mistralclient/tests/unit/v2/test_cli_action_execs.py +++ b/mistralclient/tests/unit/v2/test_cli_action_execs.py @@ -85,6 +85,38 @@ class TestCLIActionExecutions(base.BaseCommandTest): result[1] ) + def test_create_run_sync(self): + (self.client.action_executions.create. + return_value) = ACTION_EX_WITH_OUTPUT + + self.call( + action_ex_cmd.Create, + app_args=[ + 'some', '{"output": "Hello!"}', '--run-sync' + ] + ) + + self.assertDictEqual( + ACTION_EX_RESULT, + json.loads(self.app.stdout.write.call_args[0][0]) + ) + + def test_create_run_sync_and_save_result(self): + (self.client.action_executions.create. + return_value) = ACTION_EX_WITH_OUTPUT + + self.call( + action_ex_cmd.Create, + app_args=[ + 'some', '{"output": "Hello!"}', '--save-result', '--run-sync' + ] + ) + + self.assertDictEqual( + ACTION_EX_RESULT, + json.loads(self.app.stdout.write.call_args[0][0]) + ) + def test_update(self): self.client.action_executions.update.return_value = ACTION_EX diff --git a/setup.cfg b/setup.cfg index e0f00f9..acc7309 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,6 +22,14 @@ home-page = http://docs.openstack.org/developer/mistral/guides/mistralclient_gui packages = mistralclient +[build_sphinx] +source-dir = doc/source +build-dir = doc/build +all_files = 1 + +[upload_sphinx] +upload-dir = doc/build/html + [entry_points] console_scripts = mistral = mistralclient.shell:main @@ -35,7 +43,7 @@ openstack.workflow_engine.v2 = workbook_create = mistralclient.commands.v2.workbooks:Create workbook_delete = mistralclient.commands.v2.workbooks:Delete workbook_update = mistralclient.commands.v2.workbooks:Update - workbook_show_definition = mistralclient.commands.v2.workbooks:GetDefinition + workbook_definition_show = mistralclient.commands.v2.workbooks:GetDefinition workbook_validate = mistralclient.commands.v2.workbooks:Validate workflow_list = mistralclient.commands.v2.workflows:List @@ -43,7 +51,7 @@ openstack.workflow_engine.v2 = workflow_create = mistralclient.commands.v2.workflows:Create workflow_delete = mistralclient.commands.v2.workflows:Delete workflow_update = mistralclient.commands.v2.workflows:Update - workflow_show_definition = mistralclient.commands.v2.workflows:GetDefinition + workflow_definition_show = mistralclient.commands.v2.workflows:GetDefinition workflow_validate = mistralclient.commands.v2.workflows:Validate workflow_env_create = mistralclient.commands.v2.environments:Create @@ -55,8 +63,8 @@ openstack.workflow_engine.v2 = action_execution_run = mistralclient.commands.v2.action_executions:Create action_execution_list = mistralclient.commands.v2.action_executions:List action_execution_show = mistralclient.commands.v2.action_executions:Get - action_execution_show_input = mistralclient.commands.v2.action_executions:GetInput - action_execution_show_output = mistralclient.commands.v2.action_executions:GetOutput + action_execution_input_show = mistralclient.commands.v2.action_executions:GetInput + action_execution_output_show = mistralclient.commands.v2.action_executions:GetOutput action_execution_update = mistralclient.commands.v2.action_executions:Update action_execution_delete = mistralclient.commands.v2.action_executions:Delete @@ -65,13 +73,13 @@ openstack.workflow_engine.v2 = workflow_execution_update = mistralclient.commands.v2.executions:Update workflow_execution_list = mistralclient.commands.v2.executions:List workflow_execution_show = mistralclient.commands.v2.executions:Get - workflow_execution_show_input = mistralclient.commands.v2.executions:GetInput - workflow_execution_show_output = mistralclient.commands.v2.executions:GetOutput + workflow_execution_input_show = mistralclient.commands.v2.executions:GetInput + workflow_execution_output_show = mistralclient.commands.v2.executions:GetOutput task_execution_list = mistralclient.commands.v2.tasks:List task_execution_show = mistralclient.commands.v2.tasks:Get - task_execution_show_published = mistralclient.commands.v2.tasks:GetPublished - task_execution_show_result = mistralclient.commands.v2.tasks:GetResult + task_execution_published_show = mistralclient.commands.v2.tasks:GetPublished + task_execution_result_show = mistralclient.commands.v2.tasks:GetResult task_execution_rerun = mistralclient.commands.v2.tasks:Rerun action_definition_list = mistralclient.commands.v2.actions:List @@ -79,7 +87,7 @@ openstack.workflow_engine.v2 = action_definition_create = mistralclient.commands.v2.actions:Create action_definition_delete = mistralclient.commands.v2.actions:Delete action_definition_update = mistralclient.commands.v2.actions:Update - action_definition_show_definition = mistralclient.commands.v2.actions:GetDefinition + action_definition_definition_show = mistralclient.commands.v2.actions:GetDefinition cron_trigger_list = mistralclient.commands.v2.cron_triggers:List cron_trigger_show = mistralclient.commands.v2.cron_triggers:Get