Revision 3f18f035 snf-cyclades-app/synnefo/api/util.py

b/snf-cyclades-app/synnefo/api/util.py
307 307

  
308 308
def allocate_ip(network, userid, address=None, floating_ip=False):
309 309
    """Try to allocate an IP from networks IP pools."""
310
    if network.action == "DESTROY":
311
        raise faults.Conflict("Can not allocate IP. Network %s is being"
312
                              " deleted" % network.id)
310 313
    ip_pools = IPPoolTable.objects.select_for_update()\
311 314
        .filter(subnet__network=network)
312 315
    try:
......
336 339
    ip_pool_rows = IPPoolTable.objects.select_for_update()\
337 340
        .prefetch_related("subnet__network")\
338 341
        .filter(subnet__deleted=False)\
342
        .filter(subnet__network__deleted=False)\
339 343
        .filter(subnet__network__public=True)\
340 344
        .filter(subnet__network__drained=False)
341 345
    if floating_ip:

Also available in: Unified diff