Revision 2a2b01e5 snf-cyclades-app/synnefo/logic/backend.py

b/snf-cyclades-app/synnefo/logic/backend.py
742 742
    return job_ids
743 743

  
744 744

  
745
def connect_to_network(vm, network, address=None):
745
def connect_to_network(vm, nic):
746
    network = nic.network
746 747
    backend = vm.backend
747 748
    network = Network.objects.select_for_update().get(id=network.id)
748 749
    bnet, created = BackendNetwork.objects.get_or_create(backend=backend,
......
753 754

  
754 755
    depends = [[job, ["success", "error", "canceled"]] for job in depend_jobs]
755 756

  
756
    nic = {'ip': address, 'network': network.backend_id}
757
    nic = {'ip': nic.ipv4, 'network': network.backend_id}
757 758

  
758
    log.debug("Connecting vm %s to network %s(%s)", vm, network, address)
759
    log.debug("Connecting NIC %s to VM %s", nic, vm)
759 760

  
760 761
    kwargs = {
761 762
        "instance": vm.backend_vm_id,

Also available in: Unified diff