Revision 4b052f94

b/snf-cyclades-app/synnefo/logic/backend.py
642 642
    log.debug("Connecting vm %s to network %s(%s)", vm, network, address)
643 643

  
644 644
    with pooled_rapi_client(vm) as client:
645
        return client.ModifyInstance(vm.backend_vm_id, nics=[('add',  nic)],
645
        return client.ModifyInstance(vm.backend_vm_id,
646
                                     nics=[('add',  "-1", nic)],
646 647
                                     hotplug=vm.backend.use_hotplug(),
647 648
                                     depends=depends,
648 649
                                     dry_run=settings.TEST)
649 650

  
650 651

  
651 652
def disconnect_from_network(vm, nic):
652
    op = [('remove', nic.index, {})]
653
    op = [('remove', str(nic.index), {})]
653 654

  
654 655
    log.debug("Removing nic of VM %s, with index %s", vm, str(nic.index))
655 656

  

Also available in: Unified diff