Revision 1ed2557d
b/snf-cyclades-app/synnefo/api/actions.py | ||
---|---|---|
307 | 307 |
raise BadRequest('Malformed Request.') |
308 | 308 |
vm = get_vm(server_id, request.user_uniq) |
309 | 309 |
|
310 |
# Get the Network object in exclusive mode in order to |
|
311 |
# guarantee consistency of the pool |
|
312 |
net = Network.objects.select_for_update().get(id=net.id) |
|
310 |
net = Network.objects.get(id=net.id) |
|
313 | 311 |
|
314 | 312 |
if net.state != 'ACTIVE': |
315 | 313 |
raise ServiceUnavailable('Network not active yet') |
Also available in: Unified diff