Revision 03992c72 snf-cyclades-app/synnefo/api/actions.py
b/snf-cyclades-app/synnefo/api/actions.py | ||
---|---|---|
44 | 44 |
ItemNotFound, BuildInProgress) |
45 | 45 |
from synnefo.api.util import random_password, get_vm, get_nic_from_index |
46 | 46 |
from synnefo.db.models import NetworkInterface, Network |
47 |
from synnefo.logic import backend, ippool |
|
47 |
from synnefo.db.pools import IPPool |
|
48 |
from synnefo.logic import backend |
|
48 | 49 |
from synnefo.logic.utils import get_rsapi_state |
49 | 50 |
|
50 | 51 |
|
... | ... | |
313 | 314 |
raise ServiceUnavailable('Network not active yet') |
314 | 315 |
|
315 | 316 |
# Get a free IP from the address pool. |
316 |
pool = ippool.IPPool(net)
|
|
317 |
pool = IPPool(net) |
|
317 | 318 |
try: |
318 | 319 |
address = pool.get_free_address() |
319 |
except ippool.IPPool.IPPoolExhausted:
|
|
320 |
except IPPool.IPPoolExhausted: |
|
320 | 321 |
raise ServiceUnavailable('Network is full') |
321 | 322 |
pool.save() |
322 | 323 |
|
Also available in: Unified diff