Exemplo n.º 1
0
def test_create_network():
    # If this test fails, make sure you don't have a network called test_create_network
    # before runnig the tests
    assert create_docker_network('test_create_network',
                                 internal=True,
                                 cmd=local_cmd)
    assert not create_docker_network(
        'test_create_network', internal=True, cmd=local_cmd)
Exemplo n.º 2
0
def ensure_docker_network_exists(network_name, connected_containers, internal=True):
    created = create_docker_network(network_name, internal=internal)

    if not created:
        # Already existed
        return

    for container_name in connected_containers:
        sudo('docker network connect %s %s' % (network_name, container_name))
Exemplo n.º 3
0
def ensure_docker_network_exists(network_name, connected_containers, internal=True):
    created = create_docker_network(network_name, internal=internal)

    if not created:
        # Already existed
        return

    for container_name in connected_containers:
        sudo('docker network connect %s %s' % (network_name, container_name))