Revision 326c3ec8 snf-cyclades-app/synnefo/api/util.py

b/snf-cyclades-app/synnefo/api/util.py
49 49
from synnefo.db.models import (Flavor, VirtualMachine, VirtualMachineMetadata,
50 50
                               Network, BackendNetwork, NetworkInterface,
51 51
                               BridgePoolTable, MacPrefixPoolTable, Backend,
52
                               FloatingIP)
52
                               IPAddress)
53 53
from synnefo.db.pools import EmptyPool
54 54

  
55 55
from synnefo.plankton.utils import image_backend
......
226 226

  
227 227
def get_floating_ip(user_id, ipv4, for_update=False):
228 228
    try:
229
        objects = FloatingIP.objects
229
        objects = IPAddress.objects
230 230
        if for_update:
231 231
            objects = objects.select_for_update()
232 232
        return objects.get(userid=user_id, ipv4=ipv4, deleted=False)
233
    except FloatingIP.DoesNotExist:
233
    except IPAddress.DoesNotExist:
234 234
        raise faults.ItemNotFound("Floating IP does not exist.")
235 235

  
236 236

  

Also available in: Unified diff