# Path: opencenteragent/utils.py
# def detailed_exception():
#     exc_type, exc_value, exc_traceback = sys.exc_info()
#     full_traceback = repr(
#         traceback.format_exception(
#             exc_type, exc_value, exc_traceback))
# 
#     return full_traceback


import base64
import json
import logging
import os
import random
import time
from opencenteragent.utils import detailed_exception
from opencenterclient.client import OpenCenterEndpoint
from state import StateMachine, StateMachineState
from primitives import OrchestratorTasks
    output_data['result_data']['history'] = history

    output_data['result_data']['rollbacks'] = rollbacks

    if 'fails' in state_data:
        # we need to walk through all the failed nodes.
        for node in map(lambda x: int(x), state_data['fails']):
            node_list[node] = 'failed'
            if node in rollbacks and len(rollbacks[node]) > 0:
                LOG.debug('Running rollback plan for node %d: %s' %
                          (node, rollbacks[node]))

                ns['sm_description'] = rollbacks[node]
                ns['input_data'] = {'nodes': [node]}

                try:
                    exec '(rollback_result, rollback_state) = tasks.sm_eval(' \
                        'sm_description, input_data)' in ns, ns

                    if 'rollback_result' in ns and \
                            'result_code' in ns['rollback_result']:
                        if ns['rollback_result']['result_code'] == 0:
                            node_list[node] = 'rollback'
                        else:
                            LOG.debug('Error in rollback: %s: %s' %
                                      (ns['rollback_result'],
                                       ns['rollback_state']))

                except Exception as e:
                    LOG.debug('Exception running rollback: %s\n%s' %

# Path: opencenteragent/utils.py
# def detailed_exception():
#     exc_type, exc_value, exc_traceback = sys.exc_info()
#     full_traceback = repr(
#         traceback.format_exception(
#             exc_type, exc_value, exc_traceback))
# 
#     return full_traceback


# Path: opencenteragent/plugins/output/plugin_adventurator.py
import base64
import json
import logging
import os
import random
import time
from opencenteragent.utils import detailed_exception
from opencenterclient.client import OpenCenterEndpoint
from state import StateMachine, StateMachineState
from primitives import OrchestratorTasks

    output_data['result_data']['history'] = history

    output_data['result_data']['rollbacks'] = rollbacks

    if 'fails' in state_data:
        # we need to walk through all the failed nodes.
        for node in map(lambda x: int(x), state_data['fails']):
            node_list[node] = 'failed'
            if node in rollbacks and len(rollbacks[node]) > 0:
                LOG.debug('Running rollback plan for node %d: %s' %
                          (node, rollbacks[node]))

                ns['sm_description'] = rollbacks[node]
                ns['input_data'] = {'nodes': [node]}

                try:
                    exec '(rollback_result, rollback_state) = tasks.sm_eval(' \
                        'sm_description, input_data)' in ns, ns

                    if 'rollback_result' in ns and \
                            'result_code' in ns['rollback_result']:
                        if ns['rollback_result']['result_code'] == 0:
                            node_list[node] = 'rollback'
                        else:
                            LOG.debug('Error in rollback: %s: %s' %
                                      (ns['rollback_result'],
                                       ns['rollback_state']))

                except Exception as e:
                    LOG.debug('Exception running rollback: %s\n%s' %

                              (str(e), detailed_exception()))