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)
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))
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))