# Path: muranoagent/bunch.py
# class Bunch(dict):
#     def __getattr__(self, item):
#     def __setattr__(self, key, value):
#     def __delattr__(self, key):
# 
# Path: muranoagent/files_manager.py
# CONF = config.CONF
# LOG = logging.getLogger(__name__)
# class FilesManager(object):
#     def __init__(self, execution_plan):
#     def put_file(self, file_id, script):
#     def _make_symlink(self, cache_path, file_name, script):
#     def _fetch_file(self, file_id):
#     def _download_url_file(self, file_def, file_id):
#     def clear(self):
#     def _download_file(self, url, path):
#     def _url(self, file):
#     def _is_git_repository(self, url):
#     def _is_svn_repository(self, url):
#     def _download_svn(self, url_file, folder):
#     def _execute_command(self, command):
# 
# Path: muranoagent/script_runner.py
# class FunctionRunner(object):
# class ScriptRunner(object):
#     def __init__(self, name, script_runner):
#     def __call__(self, *args, **kwargs):
#     def __init__(self, name, script_info, files_manager):
#     def __call__(self, *args, **kwargs):
#     def _get_executor(self, script_type, script_name, entry_point):
#     def execute_function(self, name, *args, **kwargs):
#     def __getattr__(self, item):
#     def _load(self):
#     def _prepare_files(self):


import sys
from muranoagent import bunch
from muranoagent import files_manager as fm
from muranoagent import script_runner
        self._prepare_executors(execution_plan)

    def run(self):
        script_globals = {
            "args": bunch.Bunch(self._execution_plan.get('Parameters') or {})
        }
        script_globals.update(self._script_funcs)
        exec(self._main_script, script_globals)
        if '__execution_plan_exception' in script_globals:
            raise script_globals['__execution_plan_exception']
        return script_globals['__execution_plan_result']

    @staticmethod
    def _unindent(script, initial_indent):
        lines = script.expandtabs(4).split('\n')
        min_indent = sys.maxsize
        for line in lines:
            indent = -1
            for i, c in enumerate(line):
                if c != ' ':
                    indent = i
                    break
            if 0 <= indent < min_indent:
                min_indent = indent
        return '\n'.join([' ' * initial_indent + line[min_indent:]
                          for line in lines])

    def _prepare_executors(self, execution_plan):
        for key, value in execution_plan.Scripts.items():
            self._script_funcs[key] = script_runner.ScriptRunner(

# Path: muranoagent/bunch.py
# class Bunch(dict):
#     def __getattr__(self, item):
#     def __setattr__(self, key, value):
#     def __delattr__(self, key):
# 
# Path: muranoagent/files_manager.py
# CONF = config.CONF
# LOG = logging.getLogger(__name__)
# class FilesManager(object):
#     def __init__(self, execution_plan):
#     def put_file(self, file_id, script):
#     def _make_symlink(self, cache_path, file_name, script):
#     def _fetch_file(self, file_id):
#     def _download_url_file(self, file_def, file_id):
#     def clear(self):
#     def _download_file(self, url, path):
#     def _url(self, file):
#     def _is_git_repository(self, url):
#     def _is_svn_repository(self, url):
#     def _download_svn(self, url_file, folder):
#     def _execute_command(self, command):
# 
# Path: muranoagent/script_runner.py
# class FunctionRunner(object):
# class ScriptRunner(object):
#     def __init__(self, name, script_runner):
#     def __call__(self, *args, **kwargs):
#     def __init__(self, name, script_info, files_manager):
#     def __call__(self, *args, **kwargs):
#     def _get_executor(self, script_type, script_name, entry_point):
#     def execute_function(self, name, *args, **kwargs):
#     def __getattr__(self, item):
#     def _load(self):
#     def _prepare_files(self):


# Path: muranoagent/execution_plan_runner.py
import sys
from muranoagent import bunch
from muranoagent import files_manager as fm
from muranoagent import script_runner

        self._prepare_executors(execution_plan)

    def run(self):
        script_globals = {
            "args": bunch.Bunch(self._execution_plan.get('Parameters') or {})
        }
        script_globals.update(self._script_funcs)
        exec(self._main_script, script_globals)
        if '__execution_plan_exception' in script_globals:
            raise script_globals['__execution_plan_exception']
        return script_globals['__execution_plan_result']

    @staticmethod
    def _unindent(script, initial_indent):
        lines = script.expandtabs(4).split('\n')
        min_indent = sys.maxsize
        for line in lines:
            indent = -1
            for i, c in enumerate(line):
                if c != ' ':
                    indent = i
                    break
            if 0 <= indent < min_indent:
                min_indent = indent
        return '\n'.join([' ' * initial_indent + line[min_indent:]
                          for line in lines])

    def _prepare_executors(self, execution_plan):
        for key, value in execution_plan.Scripts.items():
            self._script_funcs[key] = script_runner.ScriptRunner(

                key, bunch.Bunch(value), self._files_manager)