How to use the jumbo.utils.session 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 / View on Github external
print_missing = []
        for k, v in missing_comp['default'].items():
            print_missing.append(' - {} {}'.format(v, k))
        print_missing.append('or High Availability:')
        for k, v in missing_comp['ha'].items():
            print_missing.append(' - {} {}'.format(v, k))
        raise ex.CreationError('service', name, 'components', print_missing,

    if name in ss.svars['nodes'][m_index]['components']:
        raise ex.CreationError('node', node, 'component', name,

github adaltas / jumbo / jumbo / cli / View on Github external
def restart(cluster_name, cluster):
    cluster = cluster_name if cluster_name else cluster

    if not cluster:
        cluster = ss.svars['cluster']

        vagrant.cmd(['vagrant', 'halt', '--color'], cluster=cluster)
        vagrant.cmd(['vagrant', 'up', '--color'], cluster=cluster)
    except (ex.LoadError, ex.CreationError) as e:
        print_with_color(e.message, 'red')
github adaltas / jumbo / jumbo / utils / View on Github external
def check_and_call(*args, **kwargs):
        if not kwargs['cluster']:
            raise ex.LoadError('cluster', None, 'NoContext')
        elif not check_cluster(kwargs['cluster']):
            raise ex.LoadError('cluster', kwargs['cluster'], 'NotExist')
        elif kwargs['cluster'] != ss.svars['cluster']:
            if ss.svars['cluster']:
                raise ex.LoadError('cluster', ss.svars['cluster'], 'MustExit')

        return func(*args, **kwargs)
    return check_and_call
github adaltas / jumbo / jumbo / core / View on Github external
def check_ip(ip, *, cluster):
    Check if a node with a specified ip is used in a specific cluster.

    :param cluster: Cluster name
    :type cluster: str
    :param ip: IP address to be tested
    :type name: str
    :raises ex.LoadError: If the cluster couldn't be loaded
    :return: True if the ip is used
    :rtype: bool
    for m in ss.svars['nodes']:
        if m['ip'] == ip:
            return m['name']

    return False