Revision 5e1d07d4 snf-cyclades-app/synnefo/api/servers.py
b/snf-cyclades-app/synnefo/api/servers.py | ||
---|---|---|
261 | 261 |
|
262 | 262 |
if backend is None: |
263 | 263 |
log.error("No available backends for VM with flavor %s", flavor) |
264 |
raise Exception("No available backends")
|
|
264 |
raise faults.ServiceUnavailable("No available backends")
|
|
265 | 265 |
except: |
266 | 266 |
transaction.rollback() |
267 | 267 |
raise |
... | ... | |
273 | 273 |
(network, address) = util.allocate_public_address(backend) |
274 | 274 |
if address is None: |
275 | 275 |
log.error("Public networks of backend %s are full", backend) |
276 |
raise faults.OverLimit("Can not allocate IP for new machine."
|
|
277 |
" Public networks are full.")
|
|
276 |
msg = "Failed to allocate public IP for new VM"
|
|
277 |
raise faults.ServiceUnavailable(msg)
|
|
278 | 278 |
nic = {'ip': address, 'network': network.backend_id} |
279 | 279 |
else: |
280 | 280 |
network = choice(list(util.backend_public_networks(backend))) |
Also available in: Unified diff