Revision 87920bc3
b/snf-cyclades-app/synnefo/api/actions.py | ||
---|---|---|
330 | 330 |
if net.state != 'ACTIVE': |
331 | 331 |
raise ServiceUnavailable('Network not active yet') |
332 | 332 |
|
333 |
# Get a free IP from the address pool. |
|
334 |
try: |
|
335 |
address = get_network_free_address(net) |
|
336 |
except EmptyPool: |
|
337 |
raise ServiceUnavailable('Network is full') |
|
333 |
address = None |
|
334 |
if net.dhcp: |
|
335 |
# Get a free IP from the address pool. |
|
336 |
try: |
|
337 |
address = get_network_free_address(net) |
|
338 |
except EmptyPool: |
|
339 |
raise ServiceUnavailable('Network is full') |
|
338 | 340 |
|
339 | 341 |
log.info("Connecting VM %s to Network %s(%s)", vm, net, address) |
340 | 342 |
|
b/snf-cyclades-app/synnefo/logic/backend.py | ||
---|---|---|
492 | 492 |
return jobs |
493 | 493 |
|
494 | 494 |
|
495 |
def connect_to_network(vm, network, address): |
|
495 |
def connect_to_network(vm, network, address=None):
|
|
496 | 496 |
nic = {'ip': address, 'network': network.backend_id} |
497 | 497 |
|
498 | 498 |
log.debug("Connecting vm %s to network %s(%s)", vm, network, address) |
Also available in: Unified diff