Revision fd2bdbb2 snf-cyclades-app/synnefo/logic/backend.py
b/snf-cyclades-app/synnefo/logic/backend.py | ||
---|---|---|
169 | 169 |
@transaction.commit_on_success |
170 | 170 |
def process_network_status(back_network, etime, jobid, opcode, status, logmsg): |
171 | 171 |
if status not in [x[0] for x in BACKEND_STATUSES]: |
172 |
return |
|
173 |
#raise Network.InvalidBackendMsgError(opcode, status) |
|
172 |
raise Network.InvalidBackendMsgError(opcode, status) |
|
174 | 173 |
|
175 | 174 |
back_network.backendjobid = jobid |
176 | 175 |
back_network.backendjobstatus = status |
... | ... | |
199 | 198 |
|
200 | 199 |
|
201 | 200 |
@transaction.commit_on_success |
201 |
def process_network_modify(back_network, etime, jobid, opcode, status, |
|
202 |
add_reserved_ips, remove_reserved_ips): |
|
203 |
assert (opcode == "OP_NETWORK_SET_PARAMS") |
|
204 |
if status not in [x[0] for x in BACKEND_STATUSES]: |
|
205 |
raise Network.InvalidBackendMsgError(opcode, status) |
|
206 |
|
|
207 |
back_network.backendjobid = jobid |
|
208 |
back_network.backendjobstatus = status |
|
209 |
back_network.opcode = opcode |
|
210 |
|
|
211 |
if add_reserved_ips or remove_reserved_ips: |
|
212 |
net = back_network.network |
|
213 |
pool = net.get_pool() |
|
214 |
if add_reserved_ips: |
|
215 |
for ip in add_reserved_ips: |
|
216 |
pool.reserve(ip, external=True) |
|
217 |
if remove_reserved_ips: |
|
218 |
for ip in remove_reserved_ips: |
|
219 |
pool.put(ip, external=True) |
|
220 |
pool.save() |
|
221 |
|
|
222 |
if status == 'success': |
|
223 |
back_network.backendtime = etime |
|
224 |
back_network.save() |
|
225 |
|
|
226 |
|
|
227 |
@transaction.commit_on_success |
|
202 | 228 |
def process_create_progress(vm, etime, progress): |
203 | 229 |
|
204 | 230 |
percentage = int(progress) |
Also available in: Unified diff