Revision 87920bc3 snf-cyclades-app/synnefo/api/actions.py

b/snf-cyclades-app/synnefo/api/actions.py
330 330
    if net.state != 'ACTIVE':
331 331
        raise ServiceUnavailable('Network not active yet')
332 332

  
333
    # Get a free IP from the address pool.
334
    try:
335
        address = get_network_free_address(net)
336
    except EmptyPool:
337
        raise ServiceUnavailable('Network is full')
333
    address = None
334
    if net.dhcp:
335
        # Get a free IP from the address pool.
336
        try:
337
            address = get_network_free_address(net)
338
        except EmptyPool:
339
            raise ServiceUnavailable('Network is full')
338 340

  
339 341
    log.info("Connecting VM %s to Network %s(%s)", vm, net, address)
340 342

  

Also available in: Unified diff