def _run_and_print_child_task_list(self, execution, args, **kwargs):
        action_exec_mgr = self.app.client.managers['LiveAction']

        instance = execution
        options = {'attributes': ['id', 'action.ref', 'parameters', 'status', 'start_timestamp',
                                  'end_timestamp']}
        options['json'] = args.json
        options['attribute_transform_functions'] = self.attribute_transform_functions
        formatter = execution_formatter.ExecutionResult

        kwargs['depth'] = args.depth
        child_instances = action_exec_mgr.get_property(execution.id, 'children', **kwargs)
        child_instances = self._format_child_instances(child_instances, execution.id)
        child_instances = format_execution_statuses(child_instances)

        if not child_instances:
            # No child error, there might be a global error, include result in the output
            options['attributes'].append('result')

        # On failure we also want to include error message and traceback at the top level
        if instance.status == 'failed':
            status_index = options['attributes'].index('status')
            if isinstance(instance.result, dict):
                tasks = instance.result.get('tasks', [])
            else:
                tasks = []

            top_level_error, top_level_traceback = self._get_top_level_error(live_action=instance)

            if len(tasks) >= 1:
                task_error, task_traceback = self._get_task_error(task=tasks[-1])
            else:
                task_error, task_traceback = None, None

            if top_level_error:
                # Top-level error
                instance.error = top_level_error
                instance.traceback = top_level_traceback
                instance.result = 'See error and traceback.'
                options['attributes'].insert(status_index + 1, 'error')
                options['attributes'].insert(status_index + 2, 'traceback')
            elif task_error:
                # Task error
                instance.error = task_error
                instance.traceback = task_traceback
                instance.result = 'See error and traceback.'
                instance.failed_on = tasks[-1].get('name', 'unknown')
                options['attributes'].insert(status_index + 1, 'error')
                options['attributes'].insert(status_index + 2, 'traceback')
                options['attributes'].insert(status_index + 3, 'failed_on')

        # print root task
        self.print_output(instance, formatter, **options)

        # print child tasks
        if child_instances:
            self.print_output(child_instances, table.MultiColumnTable,
                              attributes=['id', 'status', 'task', 'action', 'start_timestamp'],
                              widths=args.width, json=args.json,
                              attribute_transform_functions=self.attribute_transform_functions)
dataset/ETHPy150Open StackStorm/st2/st2client/st2client/commands/action.py/ActionRunCommandMixin._run_and_print_child_task_list/original