How to use the jumbo.core.services.load_services_conf function in jumbo

To help you get started, we’ve selected a few jumbo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adaltas / jumbo / jumbo / core / bundles.py View on Github external
if name not in available:
        raise RuntimeError('addbundle: bundle `%s` does not exist.' % name)

    if position == 'last':
        ss.svars['bundles'].append(name)
    elif position == 'first':
        ss.svars['bundles'].insert(0, name)
    else:
        if not position.isdigit():
            raise RuntimeError(
                'addbundle: invalid value for position. '
                'Can be `last` (default), `first`, or a number.')

        ss.svars['bundles'].insert(int(position), name)

    services.config = services.load_services_conf(cluster=cluster)
    ss.dump_config(services.get_services_components_hosts(),
                   services.config)
github adaltas / jumbo / jumbo / core / bundles.py View on Github external
def rm_bundle(*, name, cluster):
    """Remove bundle from the current cluster"""

    (active, available) = list_bundles()
    if name not in available:
        raise RuntimeError('Bundle `%s` does not exist.' % name)

    if name in active:
        index = active.index(name)
        ss.svars['bundles'].remove(name)
        services.config = services.load_services_conf(cluster=cluster)

        available_serv = []
        for serv in services.config['services']:
            available_serv.append(serv['name'])

        for serv in ss.svars['services']:
            if serv not in available_serv:
                active.insert(index, name)
                services.config = services.load_services_conf(cluster=cluster)
                raise RuntimeError('Cannot remove bundle `%s`. '
                                   'Service `%s` belongs to this bundle '
                                   'and is present on the cluster.'
                                   % (name, serv))

        ss.dump_config(services.get_services_components_hosts(),
                       services.config)
github adaltas / jumbo / jumbo / core / bundles.py View on Github external
if name not in available:
        raise RuntimeError('Bundle `%s` does not exist.' % name)

    if name in active:
        index = active.index(name)
        ss.svars['bundles'].remove(name)
        services.config = services.load_services_conf(cluster=cluster)

        available_serv = []
        for serv in services.config['services']:
            available_serv.append(serv['name'])

        for serv in ss.svars['services']:
            if serv not in available_serv:
                active.insert(index, name)
                services.config = services.load_services_conf(cluster=cluster)
                raise RuntimeError('Cannot remove bundle `%s`. '
                                   'Service `%s` belongs to this bundle '
                                   'and is present on the cluster.'
                                   % (name, serv))

        ss.dump_config(services.get_services_components_hosts(),
                       services.config)
    else:
        raise Warning('Bundle `%s` is not active.' % name)