Revision fc56ae0f
b/snf-cyclades-app/synnefo/logic/backend.py | ||
---|---|---|
415 | 415 |
|
416 | 416 |
@transaction.commit_on_success |
417 | 417 |
def process_network_modify(back_network, etime, jobid, opcode, status, |
418 |
add_reserved_ips, remove_reserved_ips):
|
|
418 |
add_reserved_ips): |
|
419 | 419 |
assert (opcode == "OP_NETWORK_SET_PARAMS") |
420 | 420 |
if status not in [x[0] for x in BACKEND_STATUSES]: |
421 | 421 |
raise Network.InvalidBackendMsgError(opcode, status) |
... | ... | |
424 | 424 |
back_network.backendjobstatus = status |
425 | 425 |
back_network.opcode = opcode |
426 | 426 |
|
427 |
if add_reserved_ips or remove_reserved_ips:
|
|
427 |
if add_reserved_ips: |
|
428 | 428 |
net = back_network.network |
429 | 429 |
pool = net.get_pool() |
430 | 430 |
if add_reserved_ips: |
431 | 431 |
for ip in add_reserved_ips: |
432 | 432 |
pool.reserve(ip, external=True) |
433 |
if remove_reserved_ips: |
|
434 |
for ip in remove_reserved_ips: |
|
435 |
pool.put(ip, external=True) |
|
436 | 433 |
pool.save() |
437 | 434 |
|
438 | 435 |
if status == 'success': |
b/snf-cyclades-app/synnefo/logic/callbacks.py | ||
---|---|---|
198 | 198 |
|
199 | 199 |
if opcode == "OP_NETWORK_SET_PARAMS": |
200 | 200 |
backend_mod.process_network_modify(network, event_time, jobid, opcode, |
201 |
status, msg['add_reserved_ips'], |
|
202 |
msg['remove_reserved_ips']) |
|
201 |
status, msg['add_reserved_ips']) |
|
203 | 202 |
else: |
204 | 203 |
backend_mod.process_network_status(network, event_time, jobid, opcode, |
205 | 204 |
status, msg['logmsg']) |
Also available in: Unified diff