Revision 9d1e6480 snf-cyclades-app/synnefo/api/util.py

b/snf-cyclades-app/synnefo/api/util.py
270 270
        objects = IPAddress.objects
271 271
        if for_update:
272 272
            objects = objects.select_for_update()
273
        return objects.get(id=floating_ip_id, floating_ip=True, userid=userid,
274
                           deleted=False)
273
        if not userid:
274
            return objects.get(id=floating_ip_id, floating_ip=True,
275
                               deleted=False)
276
        else:
277
            return objects.get(id=floating_ip_id, floating_ip=True,
278
                               userid=userid, deleted=False)
275 279
    except IPAddress.DoesNotExist:
276 280
        raise faults.ItemNotFound("Floating IP %s does not exist." %
277 281
                                  floating_ip_id)

Also available in: Unified diff