Deleting command 'get-task-output' from CLI
* Since we don't have the 'output' field in task API anymore, the related command should be deleted from CLI too. Change-Id: I5e15e191be3f6f7b0071fcc4ed5fa8bcbc82014d
This commit is contained in:
@@ -101,30 +101,6 @@ class Update(show.ShowOne):
|
||||
return format(execution)
|
||||
|
||||
|
||||
class GetOutput(command.Command):
|
||||
"""Show task output data."""
|
||||
|
||||
def get_parser(self, prog_name):
|
||||
parser = super(GetOutput, self).get_parser(prog_name)
|
||||
parser.add_argument(
|
||||
'id',
|
||||
help='Task ID')
|
||||
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
output = tasks.TaskManager(self.app.client).get(
|
||||
parsed_args.id).output
|
||||
|
||||
try:
|
||||
output = json.loads(output)
|
||||
output = json.dumps(output, indent=4) + "\n"
|
||||
except:
|
||||
LOG.debug("Task output is not JSON.")
|
||||
|
||||
self.app.stdout.write(output or "\n")
|
||||
|
||||
|
||||
class GetResult(command.Command):
|
||||
"""Show task output data."""
|
||||
|
||||
|
||||
@@ -273,7 +273,6 @@ class MistralShell(app.App):
|
||||
'task-list': mistralclient.commands.v2.tasks.List,
|
||||
'task-get': mistralclient.commands.v2.tasks.Get,
|
||||
'task-get-input': mistralclient.commands.v2.tasks.GetInput,
|
||||
'task-get-output': mistralclient.commands.v2.tasks.GetOutput,
|
||||
'task-get-result': mistralclient.commands.v2.tasks.GetResult,
|
||||
'task-update': mistralclient.commands.v2.tasks.Update,
|
||||
'action-list': mistralclient.commands.v2.actions.List,
|
||||
|
||||
@@ -35,14 +35,11 @@ TASK_INPUT = {"param1": "val1", "param2": 2}
|
||||
|
||||
TASK_WITH_RESULT_DICT = TASK_DICT.copy()
|
||||
TASK_WITH_RESULT_DICT.update({'result': json.dumps(TASK_RESULT)})
|
||||
TASK_WITH_OUTPUT_DICT = TASK_DICT.copy()
|
||||
TASK_WITH_OUTPUT_DICT.update({'output': json.dumps(TASK_RESULT)})
|
||||
TASK_WITH_INPUT_DICT = TASK_DICT.copy()
|
||||
TASK_WITH_INPUT_DICT.update({'input': json.dumps(TASK_INPUT)})
|
||||
|
||||
TASK = tasks.Task(mock, TASK_DICT)
|
||||
TASK_WITH_RESULT = tasks.Task(mock, TASK_WITH_RESULT_DICT)
|
||||
TASK_WITH_OUTPUT = tasks.Task(mock, TASK_WITH_OUTPUT_DICT)
|
||||
TASK_WITH_INPUT = tasks.Task(mock, TASK_WITH_INPUT_DICT)
|
||||
|
||||
|
||||
@@ -84,15 +81,6 @@ class TestCLIT1asksV2(base.BaseCommandTest):
|
||||
self.app.stdout.write.assert_called_with(
|
||||
json.dumps(TASK_RESULT, indent=4) + "\n")
|
||||
|
||||
@mock.patch('mistralclient.api.v2.tasks.TaskManager.get')
|
||||
def test_get_output(self, mock):
|
||||
mock.return_value = TASK_WITH_OUTPUT
|
||||
|
||||
self.call(task_cmd.GetOutput, app_args=['id'])
|
||||
|
||||
self.app.stdout.write.assert_called_with(
|
||||
json.dumps(TASK_RESULT, indent=4) + "\n")
|
||||
|
||||
@mock.patch('mistralclient.api.v2.tasks.TaskManager.get')
|
||||
def test_get_input(self, mock):
|
||||
mock.return_value = TASK_WITH_INPUT
|
||||
|
||||
Reference in New Issue
Block a user