# 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 time
import logging
import opencenter.backends
from opencenterclient.client import OpenCenterEndpoint
from opencenteragent.utils import detailed_exception
from state import StateMachine, StateMachineState
from opencenter.db import api as db_api
        plan['states'][state] = state_value
        input_state['rollback_plan'][node_id] = plan

        self.logger.debug('new rollback plan for node %s: %s' % (node_id,
                                                                 plan))
        return input_state

    def backend_wrapper(self, state_data, prim_name, fn, api, *args, **kwargs):
        """
        this runs the passed backend primitive function on all the nodes
        in the input state node list.  Failed nodes are dropped into the
        fail bucket to be rolled back.

        Right now, this runs all the backend functions in series.
        Probably it should be doing this in parallel.
        """

        nodelist_length = len(state_data['nodes'])
        result_data = {}

        # we're serializing on this.  when we shift to multi-target
        # adventures in the ui, we probably want to do this in parallel,
        # _particularly_ in the case of run_task
        #
        for node in state_data['nodes']:
            try:
                task_result = fn(state_data, api, node, *args, **kwargs)
            except Exception as e:
                task_result = {'result_code': 1,
                               'result_str': '%s: %s' % (prim_name, str(e)),

# 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/lib/primitives.py
import time
import logging
import opencenter.backends
from opencenterclient.client import OpenCenterEndpoint
from opencenteragent.utils import detailed_exception
from state import StateMachine, StateMachineState
from opencenter.db import api as db_api

        plan['states'][state] = state_value
        input_state['rollback_plan'][node_id] = plan

        self.logger.debug('new rollback plan for node %s: %s' % (node_id,
                                                                 plan))
        return input_state

    def backend_wrapper(self, state_data, prim_name, fn, api, *args, **kwargs):
        """
        this runs the passed backend primitive function on all the nodes
        in the input state node list.  Failed nodes are dropped into the
        fail bucket to be rolled back.

        Right now, this runs all the backend functions in series.
        Probably it should be doing this in parallel.
        """

        nodelist_length = len(state_data['nodes'])
        result_data = {}

        # we're serializing on this.  when we shift to multi-target
        # adventures in the ui, we probably want to do this in parallel,
        # _particularly_ in the case of run_task
        #
        for node in state_data['nodes']:
            try:
                task_result = fn(state_data, api, node, *args, **kwargs)
            except Exception as e:
                task_result = {'result_code': 1,
                               'result_str': '%s: %s' % (prim_name, str(e)),

                               'result_data': detailed_exception()}