Example #1
0
def test_second_from_node2_with_node1_walked(riak_plan):
    success = {"hosts_file1.run", "riak_service1.run", "node1.run"}
    for n in success:
        riak_plan.node[n]["status"] = states.SUCCESS.name
    filters.filter(riak_plan, start=["node2.run"])
    pending = {n for n in riak_plan if riak_plan.node[n]["status"] == states.PENDING.name}
    assert pending == {"hosts_file2.run", "riak_service2.run", "node2.run", "riak_service2.join"}
Example #2
0
def test_end_joins(riak_plan):
    filters.filter(
        riak_plan, start=["node1.run", "node2.run", "node3.run"], end=["riak_service2.join", "riak_service3.join"]
    )
    skipped = {n for n in riak_plan if riak_plan.node[n]["status"] == states.SKIPPED.name}

    assert skipped == {"riak_service1.commit"}
Example #3
0
def test_end_joins(riak_plan):
    filters.filter(riak_plan,
                   start=['node1.run', 'node2.run', 'node3.run'],
                   end=['riak_service2.join', 'riak_service3.join'])
    compare_task_to_names(
        {n for n in riak_plan if n.status == states.SKIPPED.name},
        {'riak_service1.commit'})
Example #4
0
def test_initial_from_node1_traverse(riak_plan):
    filters.filter(riak_plan, start=['node1.run'])
    pending = {
        n
        for n in riak_plan
        if riak_plan.node[n]['status'] == states.PENDING.name
    }
    assert pending == {'hosts_file1.run', 'riak_service1.run', 'node1.run'}
Example #5
0
def test_end_joins(riak_plan):
    filters.filter(
        riak_plan,
        start=['node1.run', 'node2.run', 'node3.run'],
        end=['riak_service2.join', 'riak_service3.join'])
    skipped = {n for n in riak_plan if riak_plan.node[n]['status'] == states.SKIPPED.name}

    assert skipped == {'riak_service1.commit'}
Example #6
0
def test_second_from_node2_with_node1_walked(riak_plan):
    success = {'hosts_file1.run', 'riak_service1.run', 'node1.run'}
    for n in success:
        riak_plan.node[n]['status'] = states.SUCCESS.name
    filters.filter(riak_plan, start=['node2.run'])
    pending = {n for n in riak_plan if riak_plan.node[n]['status'] == states.PENDING.name}
    assert pending == {'hosts_file2.run', 'riak_service2.run',
                       'node2.run', 'riak_service2.join'}
Example #7
0
def test_end_joins(riak_plan):
    filters.filter(riak_plan,
                   start=['node1.run', 'node2.run', 'node3.run'],
                   end=['riak_service2.join', 'riak_service3.join'])
    skipped = {
        n
        for n in riak_plan
        if riak_plan.node[n]['status'] == states.SKIPPED.name
    }

    assert skipped == {'riak_service1.commit'}
Example #8
0
def test_second_from_node2_with_node1_walked(riak_plan):
    success = {'hosts_file1.run', 'riak_service1.run', 'node1.run'}
    for task in riak_plan.nodes():
        if task.name in success:
            task.status = states.SUCCESS.name

    filters.filter(riak_plan, start=['node2.run'])
    compare_task_to_names(
        {t for t in riak_plan if t.status == states.PENDING.name},
        {'hosts_file2.run', 'riak_service2.run', 'node2.run',
         'riak_service2.join'})
Example #9
0
def test_second_from_node2_with_node1_walked(riak_plan):
    success = {'hosts_file1.run', 'riak_service1.run', 'node1.run'}
    for n in success:
        riak_plan.node[n]['status'] = states.SUCCESS.name
    filters.filter(riak_plan, start=['node2.run'])
    pending = {
        n
        for n in riak_plan
        if riak_plan.node[n]['status'] == states.PENDING.name
    }
    assert pending == {
        'hosts_file2.run', 'riak_service2.run', 'node2.run',
        'riak_service2.join'
    }
Example #10
0
def dg(uid, start, end):
    plan = graph.get_graph(uid)
    if start or end:
        errors = filters.filter(plan, start=start, end=end)
        if errors:
            raise click.ClickException('\n'.join(errors))
    utils.write_graph(plan)
    click.echo('Created {name}.svg'.format(name=plan.graph['name']))
Example #11
0
def dg(uid, start, end):
    plan = graph.get_graph(uid)
    if start or end:
        errors = filters.filter(plan, start=start, end=end)
        if errors:
            raise click.ClickException('\n'.join(errors))
    utils.write_graph(plan)
    click.echo('Created {name}.png'.format(name=plan.graph['name']))
Example #12
0
def filter(uid, start, end):
    graph.reset_filtered(uid)
    plan = graph.get_graph(uid)
    errors = filters.filter(plan, start=start, end=end)
    if errors:
        raise click.ClickException('\n'.join(errors))
    graph.update_graph(plan)
    utils.write_graph(plan)
    click.echo('Created {name}.png'.format(name=plan.graph['name']))
Example #13
0
def filter(uid, start, end):
    graph.reset_filtered(uid)
    plan = graph.get_graph(uid)
    errors = filters.filter(plan, start=start, end=end)
    if errors:
        raise click.ClickException('\n'.join(errors))
    graph.save_graph(uid, plan)
    utils.write_graph(plan)
    click.echo('Created {name}.png'.format(name=plan.graph['name']))
Example #14
0
def test_initial_from_node1_traverse(riak_plan):
    filters.filter(riak_plan, start=['node1.run'])
    pending = {n for n in riak_plan if riak_plan.node[n]['status'] == states.PENDING.name}
    assert pending == {'hosts_file1.run', 'riak_service1.run', 'node1.run'}
Example #15
0
def test_initial_from_node1_traverse(riak_plan):
    filters.filter(riak_plan, start=["node1.run"])
    pending = {n for n in riak_plan if riak_plan.node[n]["status"] == states.PENDING.name}
    assert pending == {"hosts_file1.run", "riak_service1.run", "node1.run"}
Example #16
0
def test_initial_from_node1_traverse(riak_plan):
    filters.filter(riak_plan, start=['node1.run'])
    compare_task_to_names(
        {t for t in riak_plan if t.status == states.PENDING.name},
        {'hosts_file1.run', 'riak_service1.run', 'node1.run'})