def _uninstall_excluded(modules, venv):
    """Uninstalls excluded modules.
    Since there is no way to exclude requirements from a module;
    and modules are installed from cloudify-agent's requirements;
    if any modules are chosen to be excluded, they will be uninstalled.
    :param dict modules: dict containing core and additional
    modules and the cloudify-agent module.
    :param string venv: path of virtualenv to install in.
    """
    lgr.info('Uninstalling excluded plugins (if any)...')
    for module in CORE_PLUGINS_LIST:
        module_name = get_module_name(module)
        if modules['core_plugins'].get(module) == 'exclude' and \
                utils.check_installed(module_name, venv):
            lgr.info('Uninstalling {0}'.format(module_name))
            utils.uninstall_module(module_name, venv)
def _uninstall_excluded(modules, venv):
    """Uninstalls excluded modules.
    Since there is no way to exclude requirements from a module;
    and modules are installed from cloudify-agent's requirements;
    if any modules are chosen to be excluded, they will be uninstalled.
    :param dict modules: dict containing core and additional
    modules and the cloudify-agent module.
    :param string venv: path of virtualenv to install in.
    """
    lgr.info('Uninstalling excluded plugins (if any)...')
    for module in CORE_PLUGINS_LIST:
        module_name = get_module_name(module)
        if modules['core_plugins'].get(module) == 'exclude' and \
                utils.check_installed(module_name, venv):
            lgr.info('Uninstalling {0}'.format(module_name))
            utils.uninstall_module(module_name, venv)
def _validate(modules, venv):
    """validates that all requested modules are actually installed
    within the virtualenv
    :param dict modules: dict containing core and additional
    modules and the cloudify-agent module.
    :param string venv: path of virtualenv to install in.
    """

    failed = []

    lgr.info('Validating installation...')
    modules = modules['plugins'] + modules['modules']
    for module_name in modules:
        lgr.info('Validating that {0} is installed.'.format(module_name))
        if not utils.check_installed(module_name, venv):
            lgr.error('It appears that {0} does not exist in {1}'.format(
                module_name, venv))
            failed.append(module_name)

    if failed:
        lgr.error('Validation failed. some of the requested modules were not '
                  'installed.')
        sys.exit(codes.errors['installation_validation_failed'])
def _validate(modules, venv):
    """validates that all requested modules are actually installed
    within the virtualenv
    :param dict modules: dict containing core and additional
    modules and the cloudify-agent module.
    :param string venv: path of virtualenv to install in.
    """

    failed = []

    lgr.info('Validating installation...')
    modules = modules['plugins'] + modules['modules']
    for module_name in modules:
        lgr.info('Validating that {0} is installed.'.format(module_name))
        if not utils.check_installed(module_name, venv):
            lgr.error('It appears that {0} does not exist in {1}'.format(
                module_name, venv))
            failed.append(module_name)

    if failed:
        lgr.error('Validation failed. some of the requested modules were not '
                  'installed.')
        sys.exit(codes.errors['installation_validation_failed'])
Exemple #5
0
def setup():
    """install Apache2 and its mod_wsgi module"""
    apps = ['apache2', 'libapache2-mod-wsgi']
    for app in apps:
        if not check_installed(app):
            sudo("apt-get -y install %s" % app)