Revision aeb523a4 snf-cyclades-app/synnefo/logic/backend.py
b/snf-cyclades-app/synnefo/logic/backend.py | ||
---|---|---|
287 | 287 |
if settings.PUBLIC_ROUTED_USE_POOL: |
288 | 288 |
# Get the Network object in exclusive mode in order to |
289 | 289 |
# safely (isolated) reserve an IP address |
290 |
network = Network.objects.select_for_update().get(id=1) |
|
290 |
try: |
|
291 |
network = Network.objects.select_for_update().get(public=True) |
|
292 |
except Network.DoesNotExist: |
|
293 |
raise Exception('No public network available') |
|
291 | 294 |
pool = ippool.IPPool(network) |
292 | 295 |
try: |
293 | 296 |
address = pool.get_free_address() |
Also available in: Unified diff