Revision 0fc4b580 snf-cyclades-app/synnefo/management/common.py
b/snf-cyclades-app/synnefo/management/common.py | ||
---|---|---|
35 | 35 |
from synnefo.db.models import (Backend, VirtualMachine, Network, |
36 | 36 |
Flavor, IPAddress, Subnet, |
37 | 37 |
BridgePoolTable, MacPrefixPoolTable, |
38 |
NetworkInterface) |
|
38 |
NetworkInterface, IPAddressLog)
|
|
39 | 39 |
from functools import wraps |
40 | 40 |
|
41 | 41 |
from snf_django.lib.api import faults |
... | ... | |
178 | 178 |
raise CommandError("Floating IP does not exist.") |
179 | 179 |
|
180 | 180 |
|
181 |
def get_floating_ip_log_by_address(address): |
|
182 |
try: |
|
183 |
objects = IPAddressLog.objects |
|
184 |
return objects.filter(address=address).order_by("released_at") |
|
185 |
except IPAddressLog.DoesNotExist: |
|
186 |
raise CommandError("Floating IP does not exist or it hasn't be" |
|
187 |
"attached to any server yet") |
|
188 |
|
|
189 |
|
|
181 | 190 |
def get_floating_ip_by_id(floating_ip_id, for_update=False): |
182 | 191 |
try: |
183 | 192 |
objects = IPAddress.objects |
Also available in: Unified diff