Revision 501053a1 snf-cyclades-app/synnefo/api/servers.py

b/snf-cyclades-app/synnefo/api/servers.py
297 297
    else:
298 298
        transaction.commit()
299 299

  
300
    # Allocate IP from public network
301
    try:
302
        (network, address) = util.get_public_ip(backend)
303
        nic = {'ip': address, 'network': network.backend_id}
304
    except:
305
        transaction.rollback()
306
        raise
307
    else:
308
        transaction.commit()
309

  
310 300
    # Fix flavor for archipelago
311 301
    password = util.random_password()
312 302
    disk_template, provider = util.get_flavor_provider(flavor)
......
329 319
        serial.accepted = True
330 320
        serial.save()
331 321

  
322
        # Allocate IP from public network
323
        (network, address) = util.get_public_ip(backend)
324
        nic = {'ip': address, 'network': network.backend_id}
325

  
332 326
        # We must save the VM instance now, so that it gets a valid
333 327
        # vm.backend_vm_id.
334 328
        vm = VirtualMachine.objects.create(

Also available in: Unified diff